Function fromMaybe

  • Transform a true-myth.maybe!Maybe Maybe into a Result.

    If the Maybe is a true-myth.maybe!Just Just, its value will be wrapped in the Ok variant; if it is a Maybe.Nothing Nothing the errValue will be wrapped in the Err variant.

    Type Parameters

    • T

    • E

    Parameters

    • errValue: E

      A value to wrap in an Err if maybe is a Nothing.

    • maybe: Maybe<T>

      The Maybe to convert to a Result.

    Returns Result<T, E>

  • Type Parameters

    • T

    • E

    Parameters

    • errValue: E

    Returns ((maybe) => Result<T, E>)

Generated using TypeDoc