Skip to content

Latest commit

 

History

History
95 lines (61 loc) · 1.1 KB

Free.md

File metadata and controls

95 lines (61 loc) · 1.1 KB

MODULE Free

Free

data

type Free<F, A> = Pure<F, A> | Impure<F, A, any>

Methods

ap

<B>(fab: Free<F, (a: A) => B>): Free<F, B>

ap_

<B, C>(this: Free<F, (b: B) => C>, fb: Free<F, B>): Free<F, C>

chain

<B>(f: (a: A) => Free<F, B>): Free<F, B>

inspect

(): string

isImpure

(): this is Impure<F, A, any>

isPure

(): this is Pure<F, A>

map

<B>(f: (a: A) => B): Free<F, B>

toString

(): string

foldFree

function

foldFree<M>(M: Monad<M>): <F, A>(nt: any, fa: Free<F, A>) => HKT<M, A>

hoistFree

function

hoistFree<F, G>(nt: <A>(fa: HKT<F, A>) => HKT<G, A>): (<A>(fa: Free<F, A>) => Free<G, A>)

Use a natural transformation to change the generating type constructor of a free monad

liftF

function

<F, A>(fa: HKT<F, A>): Free<F, A>

Lift an impure value described by the generating type constructor F into the free monad

of

function

<F, A>(a: A): Free<F, A>