Innovenergy_trunk/frontend/node_modules/monocle-ts/lib/At/Set.js

24 lines
640 B
JavaScript
Raw Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.atSet = void 0;
/**
* @since 1.2.0
*/
var __1 = require("..");
var S = require("fp-ts/lib/Set");
/**
* @category constructor
* @since 1.2.0
*/
function atSet(E) {
var elemE = S.elem(E);
var insertE = S.insert(E);
var removeE = S.remove(E);
return new __1.At(function (at) {
var insertEAt = insertE(at);
var removeEAt = removeE(at);
return new __1.Lens(function (s) { return elemE(at, s); }, function (a) { return function (s) { return (a ? insertEAt(s) : removeEAt(s)); }; });
});
}
exports.atSet = atSet;