UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

19 lines 565 B
/** * FromStream is a Typeclass which represents the Natural Transformation from a Stream into another * effect. * * @since 0.9.2 */ import { chainFirst } from 'fp-ts/Chain'; import { flow } from 'fp-ts/function'; export function fromStreamK(F) { return (f) => (...args) => F.fromStream(f(...args)); } export function chainStreamK(F, C) { return (f) => C.chain(flow(f, F.fromStream)); } export function chainFirstStreamK(F, C) { const chainF = chainFirst(C); return (f) => chainF(flow(f, F.fromStream)); } //# sourceMappingURL=FromStream.js.map