UNPKG

@jsoldi/hkt

Version:

Higher kinded types for typescript and a few utility monads.

14 lines 485 B
import { pipe } from "../../core/utils.js"; import { contFunctorFree } from "./contFunctorFree.js"; /** Creates a continuation monad where results are wrapped in a free monad given a free monad based on a monad. */ export function contMonadFree(m) { return pipe(contFunctorFree(m), base => { const run = cta => m.run(cta(m.unit)); return { ...base, contMonad: m, run }; }); } //# sourceMappingURL=contMonadFree.js.map