An Array.ofFn equivalent that reduces in the kernel under the
module system.
Equations
- Hex.Array.ofFn' f = (List.ofFn f).toArray
Instances For
A Vector.ofFn equivalent that reduces in the kernel under the
module system.
Equations
- Hex.Vector.ofFn' f = Vector.mk (List.ofFn f).toArray ⋯
Instances For
Compiled code uses the core Array.ofFn, which fills an array of known
capacity instead of building a List first. The List route exists
only so that the kernel can reduce it.
The Hex.Vector.ofFn' analogue of
Hex.Array.ofFn'_eq_ofFn'.
An Array.map equivalent that reduces in the kernel under the
module system: core Array.map's implementation loop is not exposed,
so (a.map f) stalls downstream exactly like Array.ofFn.
Retire once <https://github.com/leanprover/lean4/pull/14996> reaches the
pinned toolchain.
Equations
- Hex.Array.map' f a = (List.map f a.toList).toArray
Instances For
An Array.zipWith equivalent that reduces in the kernel under the
module system: core Array.zipWith runs its zipWithMAux loop by
well-founded recursion, so (Array.zipWith f a b) stalls downstream
exactly like Array.map. Retire once core exposes a structurally
recursive implementation.
Equations
- Hex.Array.zipWith' f a b = (List.zipWith f a.toList b.toList).toArray
Instances For
Compiled code uses the core Array.zipWith, which writes into an
array of known capacity; the List route exists only so that the
kernel can reduce it.