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

Function intersection

repos/effect/packages/effect/src/internal/hashSet.ts:126–134  ·  view source on GitHub ↗
(self: HashSet<V0>, that: HashSet<V1>)

Source from the content-addressed store, hash-verified

124
125/** @internal */
126export const intersection = <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1> => {
127 let result = HashMap.empty<V0 & V1, boolean>()
128 for (const value of self) {
129 if (has(that, value as any)) {
130 result = HashMap.set(result, value as V0 & V1, true)
131 }
132 }
133 return makeImpl(result)
134}
135
136/** @internal */
137export const difference = <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0> =>

Callers 1

makeReducerIntersectionFunction · 0.50

Calls 3

hasFunction · 0.70
makeImplFunction · 0.70
setMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…