Options
All
  • Public
  • Public/Protected
  • All
Menu

Package maybe

@typed/maybe

Data-type for handling "nothing" for your sanity.

Index

Type aliases

CombineArray

CombineArray: { <A, B, C>(f: (valueA: A, valueB: B) => C, maybes: [Maybe<A>, Maybe<B>]): Maybe<C>; <A, B, C, D>(f: (valueA: A, valueB: B, valueC: C) => D, maybes: [Maybe<A>, Maybe<B>, Maybe<C>]): Maybe<D>; <A, B, C, D, E>(f: (valueA: A, valueB: B, valueC: C, valueD: D) => E, maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]): Maybe<E>; <A, B, C, D, E, F>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F, maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]): Maybe<F>; <A, B, C, D, E, F, G>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G, maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]): Maybe<G>; <A, B, C>(f: (valueA: A, valueB: B) => C): (maybes: [Maybe<A>, Maybe<B>]) => Maybe<C>; <A, B, C, D>(f: (valueA: A, valueB: B, valueC: C) => D): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>]) => Maybe<D>; <A, B, C, D, E>(f: (valueA: A, valueB: B, valueC: C, valueD: D) => E): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]) => Maybe<E>; <A, B, C, D, E, F>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]) => Maybe<F>; <A, B, C, D, E, F, G>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]) => Maybe<G>; (f: ArrayConstructor): { <A, B>(maybes: [Maybe<A>, Maybe<B>]): Maybe<[A, B]>; <A, B, C>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>]): Maybe<[A, B, C]>; <A, B, C, D>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]): Maybe<[A, B, C, D]>; <A, B, C, D, E>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]): Maybe<[A, B, C, D, E]>; <A, B, C, D, E, F>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]): Maybe<[A, B, C, D, E, F]> }; <R>(f: (...values: any[]) => R, maybes: ReadonlyArray<Maybe<any>>): Maybe<R>; <R>(f: (...values: any[]) => R): (maybes: ReadonlyArray<Maybe<any>>) => Maybe<R> }

Type declaration

    • Type parameters

      • A

      • B

      • C

      Parameters

      • f: (valueA: A, valueB: B) => C
          • (valueA: A, valueB: B): C
          • Parameters

            • valueA: A
            • valueB: B

            Returns C

      • maybes: [Maybe<A>, Maybe<B>]

      Returns Maybe<C>

    • Type parameters

      • A

      • B

      • C

      • D

      Parameters

      • f: (valueA: A, valueB: B, valueC: C) => D
          • (valueA: A, valueB: B, valueC: C): D
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C

            Returns D

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>]

      Returns Maybe<D>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D) => E
          • (valueA: A, valueB: B, valueC: C, valueD: D): E
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D

            Returns E

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]

      Returns Maybe<E>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E): F
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E

            Returns F

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]

      Returns Maybe<F>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      • G

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F): G
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E
            • valueF: F

            Returns G

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]

      Returns Maybe<G>

    • Type parameters

      • A

      • B

      • C

      Parameters

      • f: (valueA: A, valueB: B) => C
          • (valueA: A, valueB: B): C
          • Parameters

            • valueA: A
            • valueB: B

            Returns C

      Returns (maybes: [Maybe<A>, Maybe<B>]) => Maybe<C>

    • Type parameters

      • A

      • B

      • C

      • D

      Parameters

      • f: (valueA: A, valueB: B, valueC: C) => D
          • (valueA: A, valueB: B, valueC: C): D
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C

            Returns D

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>]) => Maybe<D>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D) => E
          • (valueA: A, valueB: B, valueC: C, valueD: D): E
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D

            Returns E

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]) => Maybe<E>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E): F
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E

            Returns F

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]) => Maybe<F>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      • G

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F): G
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E
            • valueF: F

            Returns G

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]) => Maybe<G>

    • Parameters

      • f: ArrayConstructor

      Returns { <A, B>(maybes: [Maybe<A>, Maybe<B>]): Maybe<[A, B]>; <A, B, C>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>]): Maybe<[A, B, C]>; <A, B, C, D>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]): Maybe<[A, B, C, D]>; <A, B, C, D, E>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]): Maybe<[A, B, C, D, E]>; <A, B, C, D, E, F>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]): Maybe<[A, B, C, D, E, F]> }

    • Type parameters

      • R

      Parameters

      • f: (...values: any[]) => R
          • (...values: any[]): R
          • Parameters

            • Rest ...values: any[]

            Returns R

      • maybes: ReadonlyArray<Maybe<any>>

      Returns Maybe<R>

    • Type parameters

      • R

      Parameters

      • f: (...values: any[]) => R
          • (...values: any[]): R
          • Parameters

            • Rest ...values: any[]

            Returns R

      Returns (maybes: ReadonlyArray<Maybe<any>>) => Maybe<R>

        • Parameters

          • maybes: ReadonlyArray<Maybe<any>>

          Returns Maybe<R>

JUST

JUST: typeof JUST

MaybeOf

MaybeOf<A>: {}

Type parameters

  • A

Type declaration

MaybeValue

MaybeValue<A>: A extends Maybe<infer R> ? R : never

Type parameters

NOTHING

NOTHING: typeof Nothing

Variables

Const JUST

JUST: "@typed/Just" = '@typed/Just' as const

Const NOTHING

NOTHING: "@typed/Nothing" = '@typed/Nothing' as const

Const ap

ap: { <A, B>(fn: Maybe<(value: A) => B>, value: Maybe<A>): Maybe<B>; <A, B>(fn: Maybe<(value: A) => B>): (value: Maybe<A>) => Maybe<B> } = curry(__ap) as {<A, B>(fn: Maybe<(value: A) => B>, value: Maybe<A>): Maybe<B><A, B>(fn: Maybe<(value: A) => B>): (value: Maybe<A>) => Maybe<B>}

Applies the function contained in a Maybe to the value contained in a second Maybe.

name

ap<A, B>(fn: Maybe<(value: A) => B>, value: Maybe): Maybe

Type declaration

Const chain

chain: { <A, B>(f: (value: A) => Maybe<B>, maybe: Maybe<A>): Maybe<B>; <A, B>(f: (value: A) => Maybe<B>): (maybe: Maybe<A>) => Maybe<B> } = curry(__chain) as {<A, B>(f: (value: A) => Maybe<B>, maybe: Maybe<A>): Maybe<B><A, B>(f: (value: A) => Maybe<B>): (maybe: Maybe<A>) => Maybe<B>}

Maps a Maybe to another Maybe.

name

chain<A, B>(f: (value: A) => Maybe, maybe: Maybe): Maybe

Type declaration

Const combine

combine: { <A, B, C>(f: (valueA: A, valueB: B) => C, maybeA: Maybe<A>, maybeB: Maybe<B>): Maybe<C>; <A, B, C>(f: (valueA: A, valueB: B) => C, maybeA: Maybe<A>): (maybeB: Maybe<B>) => Maybe<C>; <A, B, C>(f: (valueA: A, valueB: B) => C): { (maybeA: Maybe<A>, maybeB: Maybe<B>): Maybe<C>; (maybeA: Maybe<A>): (maybeB: Maybe<B>) => Maybe<C> } } = curry(__combine) as {<A, B, C>(f: (valueA: A, valueB: B) => C, maybeA: Maybe<A>, maybeB: Maybe<B>): Maybe<C><A, B, C>(f: (valueA: A, valueB: B) => C, maybeA: Maybe<A>): (maybeB: Maybe<B>) => Maybe<C><A, B, C>(f: (valueA: A, valueB: B) => C): {(maybeA: Maybe<A>, maybeB: Maybe<B>): Maybe<C>(maybeA: Maybe<A>): (maybeB: Maybe<B>) => Maybe<C>}}

Applies a function with the values contained in 2 Maybes if both are Justs. If either Maybes are Nothing then Nothing is returned.

name

combine<A, B, C>(f: (a: A, b: B) => C, a: Maybe, b: Maybe): Maybe

Type declaration

Const combineArray

combineArray: { <A, B, C>(f: (valueA: A, valueB: B) => C, maybes: [Maybe<A>, Maybe<B>]): Maybe<C>; <A, B, C, D>(f: (valueA: A, valueB: B, valueC: C) => D, maybes: [Maybe<A>, Maybe<B>, Maybe<C>]): Maybe<D>; <A, B, C, D, E>(f: (valueA: A, valueB: B, valueC: C, valueD: D) => E, maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]): Maybe<E>; <A, B, C, D, E, F>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F, maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]): Maybe<F>; <A, B, C, D, E, F, G>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G, maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]): Maybe<G>; <A, B, C>(f: (valueA: A, valueB: B) => C): (maybes: [Maybe<A>, Maybe<B>]) => Maybe<C>; <A, B, C, D>(f: (valueA: A, valueB: B, valueC: C) => D): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>]) => Maybe<D>; <A, B, C, D, E>(f: (valueA: A, valueB: B, valueC: C, valueD: D) => E): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]) => Maybe<E>; <A, B, C, D, E, F>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]) => Maybe<F>; <A, B, C, D, E, F, G>(f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G): (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]) => Maybe<G>; (f: ArrayConstructor): { <A, B>(maybes: [Maybe<A>, Maybe<B>]): Maybe<[A, B]>; <A, B, C>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>]): Maybe<[A, B, C]>; <A, B, C, D>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]): Maybe<[A, B, C, D]>; <A, B, C, D, E>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]): Maybe<[A, B, C, D, E]>; <A, B, C, D, E, F>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]): Maybe<[A, B, C, D, E, F]> }; <R>(f: (...values: any[]) => R, maybes: ReadonlyArray<Maybe<any>>): Maybe<R>; <R>(f: (...values: any[]) => R): (maybes: ReadonlyArray<Maybe<any>>) => Maybe<R> } = curry(__combineArray) as CombineArray

Applies a function with all of the values contained in an array of Maybes. If any of the Maybes are Nothings then Nothing is returned.

name

combineArray(f: (...values: Array) => R, maybes: ReadonlyArray<Maybe>): R

Type declaration

    • Type parameters

      • A

      • B

      • C

      Parameters

      • f: (valueA: A, valueB: B) => C
          • (valueA: A, valueB: B): C
          • Parameters

            • valueA: A
            • valueB: B

            Returns C

      • maybes: [Maybe<A>, Maybe<B>]

      Returns Maybe<C>

    • Type parameters

      • A

      • B

      • C

      • D

      Parameters

      • f: (valueA: A, valueB: B, valueC: C) => D
          • (valueA: A, valueB: B, valueC: C): D
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C

            Returns D

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>]

      Returns Maybe<D>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D) => E
          • (valueA: A, valueB: B, valueC: C, valueD: D): E
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D

            Returns E

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]

      Returns Maybe<E>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E): F
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E

            Returns F

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]

      Returns Maybe<F>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      • G

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F): G
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E
            • valueF: F

            Returns G

      • maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]

      Returns Maybe<G>

    • Type parameters

      • A

      • B

      • C

      Parameters

      • f: (valueA: A, valueB: B) => C
          • (valueA: A, valueB: B): C
          • Parameters

            • valueA: A
            • valueB: B

            Returns C

      Returns (maybes: [Maybe<A>, Maybe<B>]) => Maybe<C>

    • Type parameters

      • A

      • B

      • C

      • D

      Parameters

      • f: (valueA: A, valueB: B, valueC: C) => D
          • (valueA: A, valueB: B, valueC: C): D
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C

            Returns D

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>]) => Maybe<D>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D) => E
          • (valueA: A, valueB: B, valueC: C, valueD: D): E
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D

            Returns E

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]) => Maybe<E>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E) => F
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E): F
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E

            Returns F

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]) => Maybe<F>

    • Type parameters

      • A

      • B

      • C

      • D

      • E

      • F

      • G

      Parameters

      • f: (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F) => G
          • (valueA: A, valueB: B, valueC: C, valueD: D, valueE: E, valueF: F): G
          • Parameters

            • valueA: A
            • valueB: B
            • valueC: C
            • valueD: D
            • valueE: E
            • valueF: F

            Returns G

      Returns (maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]) => Maybe<G>

    • Parameters

      • f: ArrayConstructor

      Returns { <A, B>(maybes: [Maybe<A>, Maybe<B>]): Maybe<[A, B]>; <A, B, C>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>]): Maybe<[A, B, C]>; <A, B, C, D>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>]): Maybe<[A, B, C, D]>; <A, B, C, D, E>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>]): Maybe<[A, B, C, D, E]>; <A, B, C, D, E, F>(maybes: [Maybe<A>, Maybe<B>, Maybe<C>, Maybe<D>, Maybe<E>, Maybe<F>]): Maybe<[A, B, C, D, E, F]> }

    • Type parameters

      • R

      Parameters

      • f: (...values: any[]) => R
          • (...values: any[]): R
          • Parameters

            • Rest ...values: any[]

            Returns R

      • maybes: ReadonlyArray<Maybe<any>>

      Returns Maybe<R>

    • Type parameters

      • R

      Parameters

      • f: (...values: any[]) => R
          • (...values: any[]): R
          • Parameters

            • Rest ...values: any[]

            Returns R

      Returns (maybes: ReadonlyArray<Maybe<any>>) => Maybe<R>

        • Parameters

          • maybes: ReadonlyArray<Maybe<any>>

          Returns Maybe<R>

Const map

map: { <A, B>(f: (value: A) => B, maybe: Maybe<A>): Maybe<B>; <A, B>(f: (value: A) => B): (maybe: Maybe<A>) => Maybe<B> } = curry(__map) as {<A, B>(f: (value: A) => B, maybe: Maybe<A>): Maybe<B><A, B>(f: (value: A) => B): (maybe: Maybe<A>) => Maybe<B>}

Applies a function to the value possibly contained in a Maybe. If the maybe is a Nothing just the Nothing is returned.

name

map<A, B>(f: (value: A) => B, maybe: Maybe): Maybe

Type declaration

Const race

race: { <A>(a: Maybe<A>, b: Maybe<A>): Maybe<A>; <A>(a: Maybe<A>): (b: Maybe<A>) => Maybe<A> } = curry(<A>(a: Maybe<A>, b: Maybe<A>): Maybe<A> => (isJust(a) ? a : b)) as {<A>(a: Maybe<A>, b: Maybe<A>): Maybe<A><A>(a: Maybe<A>): (b: Maybe<A>) => Maybe<A>}

Type declaration

Const unwrap

unwrap: { <A, B>(fn: Arity1<A, B>, maybe: Just<A>): B; <A, B>(fn: Arity1<A, B>, maybe: Maybe<A>): B | null; <A, B>(fn: Arity1<A, B>): { (maybe: Just<A>): B; (maybe: Maybe<A>): B | null } } = curry(<A, B>(fn: Arity1<A, B>, maybe: Maybe<A>): B | null => withDefault(null, map(fn, maybe)))

Used for performing side-effects with a Maybe

Type declaration

    • Type parameters

      • A

      • B

      Parameters

      Returns B

    • Type parameters

      • A

      • B

      Parameters

      Returns B | null

    • Type parameters

      • A

      • B

      Parameters

      Returns { (maybe: Just<A>): B; (maybe: Maybe<A>): B | null }

        • (maybe: Just<A>): B
        • (maybe: Maybe<A>): B | null
        • Parameters

          Returns B

        • Parameters

          Returns B | null

Const withDefault

withDefault: { <A>(defaultValue: A, maybe: Maybe<A>): A; <A>(defaultValue: A): (maybe: Maybe<A>) => A } = curry(__withDefault) as {<A>(defaultValue: A, maybe: Maybe<A>): A<A>(defaultValue: A): (maybe: Maybe<A>) => A}

Given a default value and a Maybe returns the default value if the Maybe is a Nothing or the value contained in a Just.

name

withDefault(defaultValue: A, maybe: Maybe): A

Type declaration

Functions

fromJust

  • fromJust<A>(just: Just<A>): A

isJust

  • isJust<A>(maybe: Maybe<A>): maybe is Just<A>

isNothing

  • isNothing<A>(maybe: Maybe<A>): maybe is Nothing

Const unpack

  • unpack<A, B>(fn: (value: A) => B, fallback: () => B, maybe: Maybe<A>): B
  • Type parameters

    • A

    • B

    Parameters

    • fn: (value: A) => B
        • (value: A): B
        • Parameters

          • value: A

          Returns B

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

    • maybe: Maybe<A>

    Returns B

Object literals

Const Nothing

Nothing: object

[NOTHING]

[NOTHING]: true = true

Legend

  • Namespace
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Class
  • Class with type parameter
  • Enumeration

Generated using TypeDoc