@fpjs/overture
Version:
A Javascript prelude
17 lines (16 loc) • 474 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isSemigroup = exports.concat = void 0;
var _base = require("@fpjs/overture/base");
const isSemigroup = x => "fantasy-land/concat" in x;
exports.isSemigroup = isSemigroup;
const concat = x => y => {
const op = x["fantasy-land/concat"];
if (op === undefined) {
throw TypeError(`'${(0, _base.type)(x)}' is not a Semigroup.`);
}
return op.call(x, y);
};
exports.concat = concat;