@fpjs/overture
Version:
A Javascript prelude
30 lines (29 loc) • 812 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getConst = exports.Const = void 0;
var _base = require("@fpjs/overture/base");
var _setoid = require("@fpjs/overture/algebras/setoid");
var _ord = require("@fpjs/overture/algebras/ord");
const self = function () {
return this;
};
const Const = x => ({
'@@type': 'Const',
'constructor': Const,
'getConst': x,
'fantasy-land/map': self,
'fantasy-land/ap': self,
'fantasy-land/equals': y => (0, _setoid.equals)(x)(y.getConst),
'fantasy-land/lte': y => (0, _ord.lte)(x)(y.getConst)
});
exports.Const = Const;
Const['fantasy-land/of'] = Const;
const getConst = o => {
if (!('getConst' in o)) {
throw TypeError(`${(0, _base.type)(o)} is not Const`);
}
return o['getConst'];
};
exports.getConst = getConst;