fp-ts
Version:
Functional programming in TypeScript
17 lines (16 loc) • 610 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fanin = exports.splitChoice = void 0;
var function_1 = require("./function");
function splitChoice(F) {
return function (pab, pcd) { return F.compose(F.left(pab), F.right(pcd)); };
}
exports.splitChoice = splitChoice;
function fanin(F) {
var splitChoiceF = splitChoice(F);
return function (pac, pbc) {
var join = F.promap(F.id(), function (e) { return (e._tag === 'Left' ? e.left : e.right); }, function_1.identity);
return F.compose(join, splitChoiceF(pac, pbc));
};
}
exports.fanin = fanin;