Map
The collection where each element has been transformed by ; with several collections, combines them element-wise (like zip), to the length of the shortest.
✓ checked against that system · ! checked, with disagreements (hover a chip)Fungrim entryWolfram Language
Map!Map(f, xs) — applied to each element of .Map(f, xs, ys, …)combines several collections element-wise (like zip), to the length of the shortest — .Map(f)the operator form, .Typed signatures
| Type | Package | Applies |
|---|---|---|
(any) -> any | combinatoricsreplaces compute-engine | always |
(mapping: (T) any -> U, collection<T>+) -> indexed_collection where T, U | compute-engine | always |
Details
- The mapping function is always the first argument, opposite
Fold/Scan. - With one collection, equivalent to
[f(x) for x in xs]; with several,zipWith.
Examples
About
| Examples | 20 |
|---|---|
| Checked against | Wolfram Language 13 agree5 differmathlib4 2 agree |
| Crosswalk | Fungrim entry ×18Wolfram Language |
Implementation
mapped
mathlib4packages/oracle/src/mappings.tsOne list, the function applied to each element as a ℚ (a ℕ or ℤ where its body needs one). A function whose body has no mathlib4 binding, or a list of another element type, is not emitted.