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>}
Type declaration
-
-
Type parameters
Parameters
-
fn: Maybe<(value: A) => B>
-
Returns Maybe<B>
-
Type parameters
Parameters
-
fn: Maybe<(value: A) => B>
Returns (value: Maybe<A>) => Maybe<B>
-
-
Parameters
Returns Maybe<B>
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>}
Type declaration
-
-
Type parameters
Parameters
-
f: (value: A) => Maybe<B>
-
-
Parameters
Returns Maybe<B>
-
Returns Maybe<B>
-
Type parameters
Parameters
-
f: (value: A) => Maybe<B>
-
-
Parameters
Returns Maybe<B>
Returns (maybe: Maybe<A>) => Maybe<B>
-
-
Parameters
Returns Maybe<B>
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>}}
Type declaration
-
- <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> }
-
Type parameters
Parameters
-
f: (valueA: A, valueB: B) => C
-
- (valueA: A, valueB: B): C
-
maybeA: Maybe<A>
-
maybeB: Maybe<B>
Returns Maybe<C>
-
Type parameters
Parameters
-
f: (valueA: A, valueB: B) => C
-
- (valueA: A, valueB: B): C
-
maybeA: Maybe<A>
Returns (maybeB: Maybe<B>) => Maybe<C>
-
-
Parameters
Returns Maybe<C>
-
Type parameters
Parameters
-
f: (valueA: A, valueB: B) => C
-
- (valueA: A, valueB: B): C
Returns { (maybeA: Maybe<A>, maybeB: Maybe<B>): Maybe<C>; (maybeA: Maybe<A>): (maybeB: Maybe<B>) => Maybe<C> }
-
-
Parameters
Returns Maybe<C>
-
Parameters
Returns (maybeB: Maybe<B>) => Maybe<C>
-
-
Parameters
Returns Maybe<C>
Const combineArray
combine
Array: { <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
Type declaration
-
- <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 parameters
Parameters
-
f: (valueA: A, valueB: B) => C
-
- (valueA: A, valueB: B): C
-
Returns Maybe<C>
-
Type parameters
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 Maybe<D>
-
Type parameters
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 Maybe<E>
-
Type parameters
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 Maybe<F>
-
Type parameters
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 Maybe<G>
-
Type parameters
Parameters
-
f: (valueA: A, valueB: B) => C
-
- (valueA: A, valueB: B): C
Returns (maybes: [Maybe<A>, Maybe<B>]) => Maybe<C>
-
-
Parameters
Returns Maybe<C>
-
Type parameters
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
-
-
Parameters
Returns Maybe<D>
-
Type parameters
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
-
-
Parameters
Returns Maybe<E>
-
Type parameters
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
-
-
Parameters
Returns Maybe<F>
-
Type parameters
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
-
-
Parameters
Returns Maybe<G>
-
Parameters
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]> }
-
- <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
Parameters
Returns Maybe<[A, B]>
-
Type parameters
Parameters
Returns Maybe<[A, B, C]>
-
Type parameters
Parameters
Returns Maybe<[A, B, C, D]>
-
Type parameters
Parameters
Returns Maybe<[A, B, C, D, E]>
-
Type parameters
Parameters
Returns Maybe<[A, B, C, D, E, F]>
-
Type parameters
Parameters
-
f: (...values: any[]) => R
-
maybes: ReadonlyArray<Maybe<any>>
Returns Maybe<R>
-
Type parameters
Parameters
-
f: (...values: any[]) => 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>}
Type declaration
-
- <A, B>(f: (value: A) => B, maybe: Maybe<A>): Maybe<B>
- <A, B>(f: (value: A) => B): (maybe: Maybe<A>) => Maybe<B>
-
Type parameters
Parameters
Returns Maybe<B>
-
Type parameters
Parameters
Returns (maybe: Maybe<A>) => Maybe<B>
-
-
Parameters
Returns Maybe<B>
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
-
-
Type parameters
Parameters
Returns Maybe<A>
-
Type parameters
Parameters
Returns (b: Maybe<A>) => Maybe<A>
-
-
Parameters
Returns Maybe<A>
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)))
Type declaration
-
-
Type parameters
Parameters
Returns B
-
Type parameters
Parameters
Returns B | null
-
Type parameters
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
with
Default: { <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}
Type declaration
-
- <A>(defaultValue: A, maybe: Maybe<A>): A
- <A>(defaultValue: A): (maybe: Maybe<A>) => A
-
Type parameters
Parameters
Returns A
-
Type parameters
Parameters
Returns (maybe: Maybe<A>) => A
@typed/maybe