24 lines
640 B
JavaScript
24 lines
640 B
JavaScript
|
"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;
|