UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

26 lines 571 B
import * as IO from 'fp-ts/IO'; import * as IOE from 'fp-ts/IOEither'; import { pipe } from './function'; import { swapEithers } from './internal'; /** * @since 0.9.2 * @category Combinator */ export const chainRec = (f) => (value) => pipe(value, IO.chainRec((a) => pipe(a, f, IO.map(swapEithers)))); /** * @since 0.9.2 * @category Instance */ export const ChainRec = { chainRec, }; /** * @since 0.9.2 * @category Instance */ export const MonadRec = { ...IOE.Monad, ...ChainRec, }; export * from 'fp-ts/IOEither'; //# sourceMappingURL=IOEither.js.map