(E: Equivalence.Equivalence<A>)
| 42 | * The set of elements which are in both the first and second set |
| 43 | */ |
| 44 | export function intersection_<A>(E: Equivalence.Equivalence<A>): (l: Set<A>, r: Set<A>) => Set<A> { |
| 45 | const elemE = elem_(E) |
| 46 | return (x, y) => { |
| 47 | if (x === empty || y === empty) { |
| 48 | return empty |
| 49 | } |
| 50 | const r = new Set<A>() |
| 51 | x.forEach((e) => { |
| 52 | if (elemE(y, e)) { |
| 53 | r.add(e) |
| 54 | } |
| 55 | }) |
| 56 | return r |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * The set of elements which are in both the first and second set |
no test coverage detected
searching dependent graphs…