map_values(r: record, f: fn (T) -> U) → record
Category: [records](builtinsrecords)_
Apply a function to every field value of a record, keeping the keys.
| Parameter | Type | Description | Remarks |
|---|---|---|---|
| r | record | The record to transform. | — |
| f | fn (T) -> U | Function applied to each field value. | — |
| returns | record | A record with the same keys and transformed values. | — |
wcl
map_values({ low: 1, high: 9 }, fn(x: i64) -> i64 { x * 2 }) // double every value, keep the keys → { high: 18, low: 2 }