* Apply a function to all records in the collection.
(f: (data: T) => U)
| 34 | * Apply a function to all records in the collection. |
| 35 | */ |
| 36 | map<U>(f: (data: T) => U): MultiSet<U> { |
| 37 | return new MultiSet( |
| 38 | this.#inner.map(([data, multiplicity]) => [f(data), multiplicity]), |
| 39 | ) |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Filter out records for which a function f(record) evaluates to False. |
no outgoing calls