Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Maybe<A>

Type parameters

  • A

Hierarchy

Index

Properties

nothing: Maybe<never> = ...

Methods

  • _open(): unknown
  • case<B>(f: (a: A) => B, n: () => B): any
  • Type parameters

    • B

    Parameters

    • f: (a: A) => B
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    • n: () => B
        • (): B
        • Returns B

    Returns any

  • fmap<B>(f: (a: A) => B): Maybe<B>
  • Type parameters

    • B

    Parameters

    • f: (a: A) => B
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    Returns Maybe<B>

  • fromJust(): A
  • fromMaybe(d: A): A
  • identity<T>(): T
  • isJust(): boolean
  • isNothing(): boolean
  • isValide(): boolean
  • maybeToList(): A[]
  • case<A, B>(a: Maybe<A>, f: (a: A) => B, n: () => B): B
  • Type parameters

    • A

    • B

    Parameters

    • a: Maybe<A>
    • f: (a: A) => B
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    • n: () => B
        • (): B
        • Returns B

    Returns B

  • catMaybes<A>(a: Maybe<A>[]): A[]
  • Type parameters

    • A

    • B

    Parameters

    • f: (a: A) => B
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    • a: Maybe<A>

    Returns Maybe<B>

  • fromJust<A>(a: Maybe<A>): A
  • fromMaybe<A>(d: A, a: Maybe<A>): A
  • isJust<A>(a: Maybe<A>): boolean
  • isNothing<A>(a: Maybe<A>): boolean
  • lift<A, B>(f: (a: A) => B): (a: Maybe<A>) => Maybe<B>
  • liftFromThrowable<A, Args>(f: (...a: Args) => A): (...a: Args) => Maybe<A>
  • Type parameters

    • A

    • Args: unknown[]

    Parameters

    • f: (...a: Args) => A
        • (...a: Args): A
        • Parameters

          • Rest ...a: Args

          Returns A

    Returns (...a: Args) => Maybe<A>

      • Parameters

        • Rest ...a: Args

        Returns Maybe<A>

  • liftFromThrowableAsync<A, Args>(f: (...a: Args) => Promise<A>): (...a: Args) => Promise<Maybe<A>>
  • Type parameters

    • A

    • Args: unknown[]

    Parameters

    • f: (...a: Args) => Promise<A>
        • (...a: Args): Promise<A>
        • Parameters

          • Rest ...a: Args

          Returns Promise<A>

    Returns (...a: Args) => Promise<Maybe<A>>

      • (...a: Args): Promise<Maybe<A>>
      • Parameters

        • Rest ...a: Args

        Returns Promise<Maybe<A>>

  • listToMaybe<A>(a: A[]): Maybe<A>
  • mapMaybe<A, B>(f: (a: A) => Maybe<B>, a: A[]): B[]
  • maybeToList<A>(a: Maybe<A>): A[]

Generated using TypeDoc