MCPcopy Index your code
hub / github.com/Effect-TS/effect / differenceWith

Function differenceWith

packages/effect/src/Array.ts:2399–2411  ·  view source on GitHub ↗
(isEquivalent: (self: A, that: A) => boolean)

Source from the content-addressed store, hash-verified

2397 * @since 2.0.0
2398 */
2399export const differenceWith = <A>(isEquivalent: (self: A, that: A) => boolean): {
2400 (that: Iterable<A>): (self: Iterable<A>) => Array<A>
2401 (self: Iterable<A>, that: Iterable<A>): Array<A>
2402} => {
2403 const has = containsWith(isEquivalent)
2404 return dual(
2405 2,
2406 (self: Iterable<A>, that: Iterable<A>): Array<A> => {
2407 const bs = fromIterable(that)
2408 return fromIterable(self).filter((a) => !has(bs, a))
2409 }
2410 )
2411}
2412
2413/**
2414 * Creates a `Array` of values not included in the other given `Iterable`.

Callers 3

Array.tsFile · 0.70
Chunk.test.tsFile · 0.50
Array.test.tsFile · 0.50

Calls 3

containsWithFunction · 0.70
fromIterableFunction · 0.70
hasFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…