UNPKG

@typed/fp

Version:

Data Structures and Resources for fp-ts

43 lines 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useAllWithKV = exports.useSomeWithKV = exports.provideAllWithKV = exports.provideSomeWithKV = exports.chainFirstKVK = exports.chainKVK = exports.fromKVK = void 0; const tslib_1 = require("tslib"); /** * FromKV is a Typeclass which represents the Natural Transformation from an KV into another * effect. * * @since 0.11.0 */ const Chain_1 = require("fp-ts/Chain"); const function_1 = require("fp-ts/function"); const Provide = (0, tslib_1.__importStar)(require("./Provide")); function fromKVK(F) { return (f) => (...args) => F.fromKV(f(...args)); } exports.fromKVK = fromKVK; function chainKVK(F, C) { return (f) => C.chain((0, function_1.flow)(f, F.fromKV)); } exports.chainKVK = chainKVK; function chainFirstKVK(F, C) { const chainF = (0, Chain_1.chainFirst)(C); return (f) => chainF((0, function_1.flow)(f, F.fromKV)); } exports.chainFirstKVK = chainFirstKVK; function provideSomeWithKV(F) { return (0, function_1.flow)(F.fromKV, Provide.provideSomeWith(F)); } exports.provideSomeWithKV = provideSomeWithKV; function provideAllWithKV(F) { return (0, function_1.flow)(F.fromKV, Provide.provideAllWith(F)); } exports.provideAllWithKV = provideAllWithKV; function useSomeWithKV(F) { return (0, function_1.flow)(F.fromKV, Provide.useSomeWith(F)); } exports.useSomeWithKV = useSomeWithKV; function useAllWithKV(F) { return (0, function_1.flow)(F.fromKV, Provide.useAllWith(F)); } exports.useAllWithKV = useAllWithKV; //# sourceMappingURL=FromKV.js.map