fnts 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module Either Operators
|
|
3
|
+
*/
|
|
4
|
+
import type { Map } from '../../types';
|
|
5
|
+
import type { Either } from '../either';
|
|
6
|
+
/**
|
|
7
|
+
* Maps right value to a new monad returning it.
|
|
8
|
+
*/
|
|
9
|
+
export default function bindr<LeftValue, RightValue, NextRightValue>(mapRight: Map<RightValue, Either<LeftValue, NextRightValue>>): (monad: Either<LeftValue, RightValue>) => Either<LeftValue, NextRightValue>;
|
|
10
|
+
/**
|
|
11
|
+
* Maps right value to a new monad returning it.
|
|
12
|
+
*/
|
|
13
|
+
export default function bindr<LeftValue, RightValue, NextRightValue>(monad: Either<LeftValue, RightValue>, mapRight: Map<RightValue, Either<LeftValue, NextRightValue>>): Either<LeftValue, NextRightValue>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module Either Operators
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var compose_1 = require("../../compose");
|
|
7
|
+
var ternary_1 = require("../../ternary");
|
|
8
|
+
var identity_1 = require("../../identity");
|
|
9
|
+
var permutation_2_1 = require("../../permutation/permutation-2");
|
|
10
|
+
var bifold_1 = require("./bifold");
|
|
11
|
+
var guards_1 = require("./guards");
|
|
12
|
+
function bindr() {
|
|
13
|
+
var args = [];
|
|
14
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
15
|
+
args[_i] = arguments[_i];
|
|
16
|
+
}
|
|
17
|
+
return permutation_2_1.default(function (monad, mapRight) {
|
|
18
|
+
return ternary_1.default(guards_1.isRight, compose_1.default(mapRight, bifold_1.bifoldr), identity_1.default)(monad);
|
|
19
|
+
}).apply(void 0, args);
|
|
20
|
+
}
|
|
21
|
+
exports.default = bindr;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { bifoldl, Bifoldl, bifoldr, Bifoldr, default as bifold, Bifold, } from './bifold';
|
|
2
2
|
export * from './guards';
|
|
3
|
+
export { default as bindr } from './bindr';
|
|
3
4
|
export { default as bifoldMap } from './bifold-map';
|
|
4
5
|
export { default as bimap, first, second } from './bimap';
|
|
@@ -10,12 +10,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.second = exports.first = exports.bimap = exports.bifoldMap = exports.bifold = exports.bifoldr = exports.bifoldl = void 0;
|
|
13
|
+
exports.second = exports.first = exports.bimap = exports.bifoldMap = exports.bindr = exports.bifold = exports.bifoldr = exports.bifoldl = void 0;
|
|
14
14
|
var bifold_1 = require("./bifold");
|
|
15
15
|
Object.defineProperty(exports, "bifoldl", { enumerable: true, get: function () { return bifold_1.bifoldl; } });
|
|
16
16
|
Object.defineProperty(exports, "bifoldr", { enumerable: true, get: function () { return bifold_1.bifoldr; } });
|
|
17
17
|
Object.defineProperty(exports, "bifold", { enumerable: true, get: function () { return bifold_1.default; } });
|
|
18
18
|
__exportStar(require("./guards"), exports);
|
|
19
|
+
var bindr_1 = require("./bindr");
|
|
20
|
+
Object.defineProperty(exports, "bindr", { enumerable: true, get: function () { return bindr_1.default; } });
|
|
19
21
|
var bifold_map_1 = require("./bifold-map");
|
|
20
22
|
Object.defineProperty(exports, "bifoldMap", { enumerable: true, get: function () { return bifold_map_1.default; } });
|
|
21
23
|
var bimap_1 = require("./bimap");
|