id | title |
---|---|
Free |
Module Free |
Signature (data type) Source
export type Free<F, A> = Pure<F, A> | Impure<F, A, any>
export class Pure<F, A> {
constructor(readonly value: A) {}
...
}
export class Impure<F, A, X> {
constructor(readonly fx: HKT<F, X>, readonly f: (x: X) => Free<F, A>) {}
...
}
Signature (method) Source
ap<B>(fab: Free<F, (a: A) => B>): Free<F, B> { ... }
Added in v1.0.0
Flipped version of ap
Signature (method) Source
ap_<B, C>(this: Free<F, (b: B) => C>, fb: Free<F, B>): Free<F, C> { ... }
Added in v1.0.0
Signature (method) Source
chain<B>(f: (a: A) => Free<F, B>): Free<F, B> { ... }
Added in v1.0.0
Signature (method) Source
inspect(): string { ... }
Added in v1.0.0
Signature (method) Source
isImpure(): this is Impure<F, A, any> { ... }
Added in v1.0.0
Signature (method) Source
isPure(): this is Pure<F, A> { ... }
Added in v1.0.0
Signature (method) Source
map<B>(f: (a: A) => B): Free<F, B> { ... }
Added in v1.0.0
Signature (method) Source
toString(): string { ... }
Added in v1.0.0
Added in v1.0.0
Signature (function) Source
export function foldFree<M>(M: Monad<M>): <F, A>(nt: any, fa: Free<F, A>) => HKT<M, A> { ... }
Added in v1.0.0
Use a natural transformation to change the generating type constructor of a free monad
Signature (function) Source
export function hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): (<A>(fa: Free<F, A>) => Free<G, A>) { ... }
Added in v1.0.0
Lift an impure value described by the generating type constructor F
into the free monad
Signature (function) Source
export const liftF = <F, A>(fa: HKT<F, A>): Free<F, A> => { ... }
Added in v1.0.0
Signature (function) Source
export const of = <F, A>(a: A): Free<F, A> => { ... }
Added in v1.0.0