(self: HashSet<V>, predicate: (value: V) => boolean)
| 103 | |
| 104 | // Helper function for building new HashSets from iteration |
| 105 | const fromPredicate = <V>(self: HashSet<V>, predicate: (value: V) => boolean): HashSet<V> => { |
| 106 | let result = HashMap.empty<V, boolean>() |
| 107 | for (const value of self) { |
| 108 | if (predicate(value)) { |
| 109 | result = HashMap.set(result, value, true) |
| 110 | } |
| 111 | } |
| 112 | return makeImpl(result) |
| 113 | } |
| 114 | |
| 115 | /** @internal */ |
| 116 | export const union = <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 | V1> => { |
no test coverage detected
searching dependent graphs…