/** * @tsplus static SortedSet.Aspects map * @tsplus pipeable SortedSet map */ export function map(ord: Ord, f: (a: A) => B) { return (self: SortedSet): SortedSet => { let out = SortedSet.empty(ord) self.forEach((a) => { const b = f(a) if (!out.has(b)) { out = out.add(b) } }) return out } }