Function nothing

  • Create a Maybe instance which is a Nothing.

    If you want to create an instance with a specific type, e.g. for use in a function which expects a Maybe<T> where the <T> is known but you have no value to give it, you can use a type parameter:

    const notString = Maybe.nothing<string>();
    

    Type Parameters

    • T

    Parameters

    • Optional _: null
      Optional

    Returns Nothing<T>

    An instance of Maybe.Nothing<T>.

    Typeparam

    T The type of the item contained in the Maybe.

Generated using TypeDoc