since import { At , Lens } from '..' ; import { Eq } from 'fp-ts/lib/Eq' ; import * as S from 'fp-ts/lib/Set' ; category since export function atSet < A = never > ( E ) { const elemE = S . elem ( E ) ; const insertE = S . insert ( E ) ; const removeE = S . remove ( E ) ; return new At ( ( at ) => { const insertEAt = insertE ( at ) ; const removeEAt = removeE ( at ) ; return new Lens ( ( s ) => elemE ( at , s ) , ( a ) => ( s ) => ( a ? insertEAt ( s ) : removeEAt ( s ) ) ) ; } ) ; }