24 lines
752 B
JavaScript
24 lines
752 B
JavaScript
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.fanin = exports.splitChoice = exports.fanIn = exports.split = void 0;
|
||
|
var function_1 = require("./function");
|
||
|
function split(P, C) {
|
||
|
return function (pab, pcd) { return C.compose(P.right(pcd), P.left(pab)); };
|
||
|
}
|
||
|
exports.split = split;
|
||
|
function fanIn(P, C) {
|
||
|
var splitPC = split(P, C);
|
||
|
return function (pac, pbc) {
|
||
|
return C.compose(P.promap(C.id(), function (cc) { return (cc._tag === 'Left' ? cc.left : cc.right); }, function_1.identity), splitPC(pac, pbc));
|
||
|
};
|
||
|
}
|
||
|
exports.fanIn = fanIn;
|
||
|
function splitChoice(F) {
|
||
|
return split(F, F);
|
||
|
}
|
||
|
exports.splitChoice = splitChoice;
|
||
|
function fanin(F) {
|
||
|
return fanIn(F, F);
|
||
|
}
|
||
|
exports.fanin = fanin;
|