UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

25 lines 871 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.chainFirstStreamK = exports.chainStreamK = exports.fromStreamK = void 0; /** * FromStream is a Typeclass which represents the Natural Transformation from a Stream into another * effect. * * @since 0.9.2 */ const Chain_1 = require("fp-ts/Chain"); const function_1 = require("fp-ts/function"); function fromStreamK(F) { return (f) => (...args) => F.fromStream(f(...args)); } exports.fromStreamK = fromStreamK; function chainStreamK(F, C) { return (f) => C.chain((0, function_1.flow)(f, F.fromStream)); } exports.chainStreamK = chainStreamK; function chainFirstStreamK(F, C) { const chainF = (0, Chain_1.chainFirst)(C); return (f) => chainF((0, function_1.flow)(f, F.fromStream)); } exports.chainFirstStreamK = chainFirstStreamK; //# sourceMappingURL=FromStream.js.map