UNPKG

@jsoldi/hkt

Version:

Higher kinded types for typescript and a few utility monads.

22 lines 1.01 kB
import { IFunctor } from "../../classes/functor.js"; import { IMonad } from "../../classes/monad.js"; import { KLazy } from "../lazy.js"; import { KTask } from "../task.js"; import { IFunctorFree } from "./functorFree.js"; import { IMonadFree } from "./monadFree.js"; /** The free monad factory. */ export interface IFreeFactory { /** A free-monad that uses the lazy functor as the underlying functor for safe tail recursion. */ trampoline: IMonadFree<KLazy>; /** A free-monad that uses the task functor as the underlying functor for safe tail recursion. */ trampolineAsync: IMonadFree<KTask>; /** Creates a free monad from a functor. */ ofFunctor<F>(f: IFunctor<F>): IFunctorFree<F>; /** Creates a free monad from a monad. */ ofMonad<F>(m: IMonad<F>): IMonadFree<F>; } /** The free monad module. */ export declare const free: IFreeFactory; export { Free, KFree, IFunctorFree } from "./functorFree.js"; export { IMonadFree } from "./monadFree.js"; //# sourceMappingURL=free.d.ts.map