MCPcopy Create free account
hub / github.com/effect-app/libs / intersection_

Function intersection_

packages/effect-app/src/Set.ts:44–58  ·  view source on GitHub ↗
(E: Equivalence.Equivalence<A>)

Source from the content-addressed store, hash-verified

42 * The set of elements which are in both the first and second set
43 */
44export 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

Callers 1

intersectionFunction · 0.85

Calls 3

elem_Function · 0.85
forEachMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…