UNPKG

601 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.MaybeMonad = exports.MaybeUnit = void 0;
4const lang_1 = require("../lang");
5const monad_1 = require("./monad");
6exports.MaybeUnit = monad_1.createUnit((monad, value) => {
7 if (!lang_1.isDefined(value)) {
8 monad.bind = _ => monad;
9 }
10});
11var MaybeMonad;
12(function (MaybeMonad) {
13 function fromNullable(value) {
14 return exports.MaybeUnit(value);
15 }
16 MaybeMonad.fromNullable = fromNullable;
17})(MaybeMonad = exports.MaybeMonad || (exports.MaybeMonad = {}));
18//# sourceMappingURL=maybe.js.map
\No newline at end of file