UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

21 lines 557 B
import { pipe } from 'fp-ts/function'; import * as TE from 'fp-ts/TaskEither'; import { swapEithers } from './internal'; import * as T from './Task'; /** * @since 0.9.2 * @category Combinator */ export const chainRec = (f) => (value) => pipe(value, T.chainRec((a) => pipe(a, f, T.map(swapEithers)))); /** * @since 0.9.2 * @category Instance */ export const ChainRec = { chainRec }; /** * @since 0.9.2 * @category Instance */ export const MonadRec = { ...TE.Monad, chainRec }; export * from 'fp-ts/TaskEither'; //# sourceMappingURL=TaskEither.js.map