Package: effect
Module: Array
Removes duplicates using Equal.equivalence(), preserving the order of the
first occurrence.
When to use
Use to remove repeated values from an iterable when Effect’s default equality is the right comparison, preserving the first occurrence.
Example (Removing duplicates)
import { Array } from "effect"
console.log(Array.dedupe([1, 2, 1, 3, 2, 4])) // [1, 2, 3, 4]
See
dedupeWith — use custom equalitydedupeAdjacent — only dedupes consecutive elementsSignature
declare const dedupe: <S extends Iterable<any>>(self: S) => S extends NonEmptyReadonlyArray<infer A> ? NonEmptyArray<A> : S extends Iterable<infer A> ? Array<A> : never
Since v2.0.0