Interface Nothing<R>

Absolutely Nothing

Maybe data type specialiation representing an absence of any value

interface Nothing<R> {
    generator: MaybeGeneratorFunction<[], R, Nothing<R>, R>;
    chain<R2>(this, op): Nothing<never>;
    chain<R2>(this, op): Nothing<never>;
    chain<R2>(this, op): Nothing<never>;
    chain<R2>(this, op): Maybe<R2>;
    chain<R2>(this, op): Nothing<never>;
    chain<R2>(this, op): Maybe<R2>;
    isJust(): this is Just<R>;
    isNothing(): this is Nothing<R>;
    map<R2>(this, op): Nothing<never>;
    map<R2>(this, op): Maybe<R2>;
    matchChain<R2, R3>(this, op): Just<R3>;
    matchChain<R2, R3>(this, op): Nothing<never>;
    matchChain<R2, R3>(this, op): Just<R3>;
    matchChain<R2, R3>(this, op): Nothing<never>;
    matchChain<R2, R3>(this, op): Maybe<R3>;
    matchChain<R2, R3>(this, op): Maybe<R3>;
    matchChain<R2, R3>(this, op): Just<R3>;
    matchChain<R2, R3>(this, op): Nothing<never>;
    matchChain<R2, R3>(this, op): Maybe<R3>;
    matchChain<R2, R3>(this, op): Just<R2 | R3>;
    matchChain<R2, R3>(this, op): Maybe<R2>;
    matchChain<R2, R3>(this, op): Maybe<R3>;
    matchChain<R2, R3>(this, op): Nothing<never>;
    matchChain<R2, R3>(this, op): Maybe<R2 | R3>;
    matchChain<R2, R3>(this, op): Maybe<R3>;
    matchChain<R2, R3>(this, op): Maybe<R2 | R3>;
    matchChain<R2, R3>(this, op): Maybe<R2>;
    matchChain<R2, R3>(this, op): Maybe<R2 | R3>;
    matchMap<R2, R3>(this, op): Just<R3>;
    matchMap<R2, R3>(this, op): Just<R2 | R3>;
    matchTap(op): this;
    orChain<R2>(this, op): Just<R2>;
    orChain<R2>(this, op): Nothing<never>;
    orChain<R2>(this, op): Maybe<R2>;
    orChain<R2>(this, op): Just<R | R2>;
    orChain<R2>(this, op): Maybe<R>;
    orChain<R2>(this, op): Maybe<R | R2>;
    orMap<R2>(this, op): Just<R2>;
    orMap<R2>(this, op): Just<R | R2>;
    orTap(op): this;
    tap(op): this;
}

Type Parameters

  • R

Properties

generator: MaybeGeneratorFunction<[], R, Nothing<R>, R>

Wrap Maybe to singleton generator

Userful in order to avoid ambiguous yied types

Returns

generator of Maybe wrapping this

Methods

  • Maybe type guard for 'just'

    Returns this is Just<R>

    'true' in case wrapped value exists (and resolves this type to be 'just')

    Example

    if (maybe.isJust()) {
    console.log(maybe.just);
    }
  • Maybe type guard for 'nothing'

    Returns this is Nothing<R>

    'true' in case wrapped value is 'nothing' (and resolves this type to be 'nothing')

    Example

    if (maybe.isNohing()) {
    console.log('nothing');
    }
  • Maybe transformer function

    Applied to 'just value' returns 'just op(value)' Applied to 'nothing' returns self without invoking transformer

    Type Parameters

    • R2

      transformer function's return type

    Parameters

    • this: Nothing<R>
    • op: ((value) => R2)

      transformer to be invoked with underlying value

        • (value): R2
        • Parameters

          • value: R

          Returns R2

    Returns Nothing<never>

    'just op(value)' or 'nothing'

  • Type Parameters

    • R2

    Parameters

    • this: Maybe<R>
    • op: ((value) => R2)
        • (value): R2
        • Parameters

          • value: R

          Returns R2

    Returns Maybe<R2>

  • Maybe patter matching transformer function

    Applied to 'just value' returns 'just op.just(value)' Applied to 'nothing' returns 'just op.nothing()'

    Type Parameters

    • R2

      just transformer function's return type

    • R3 = R2

      nothing transformer function's return type

    Parameters

    • this: Nothing<R>
    • op: {
          just: ((value) => R2);
          nothing: (() => R3);
      }
      • just: ((value) => R2)

        transformer to be invoked with underlying value in case of just

          • (value): R2
          • transformer to be invoked with underlying value in case of just

            Parameters

            • value: R

            Returns R2

      • nothing: (() => R3)

        transformer to be invoked in case of nothing

          • (): R3
          • transformer to be invoked in case of nothing

            Returns R3

    Returns Just<R3>

    'just op.just(value)' or 'just op.nothing()'

  • Type Parameters

    Parameters

    • this: Maybe<R>
    • op: {
          just: ((value) => R2);
          nothing: (() => R3);
      }
      • just: ((value) => R2)
          • (value): R2
          • Parameters

            • value: R

            Returns R2

      • nothing: (() => R3)

    Returns Just<R2 | R3>

  • Maybe patter matching peeker function

    Applied to 'just value' returns self invoking op.just(value) in process Applied to 'nothing' returns self invoking op.nothing() in process

    Parameters

    • op: {
          just: ((value) => void);
          nothing: (() => void);
      }
      • just: ((value) => void)

        function to be invoked with underlying value in case of just

          • (value): void
          • function to be invoked with underlying value in case of just

            Parameters

            • value: R

            Returns void

      • nothing: (() => void)

        function to be invoked in case of nothing

          • (): void
          • function to be invoked in case of nothing

            Returns void

    Returns this

    self

  • Maybe fallback transformer function

    Applied to 'just value' returns self without invoking transformer Applied to 'nothing' returns 'just op()'

    Type Parameters

    • R2

    Parameters

    Returns Just<R2>

    'just value' or 'just op()'

  • Type Parameters

    • R2

    Parameters

    Returns Just<R | R2>

  • Maybe fallback peeker function

    Applied to 'just value' returns self without invoking callback Applied to 'nothing' returns self invoking op() in process

    Parameters

    • op: (() => void)

      function to be invoked

        • (): void
        • Returns void

    Returns this

    self

  • Maybe peeker function

    Applied to 'just value' returns self invoking op(value) in process Applied to 'nothing' returns self without invoking callback

    Parameters

    • op: ((value) => void)

      function to be invoked with underlying value

        • (value): void
        • Parameters

          • value: R

          Returns void

    Returns this

    self

Generated using TypeDoc