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.
Remove this shim and migrate its callers to core Array.map when the
pinned toolchain reaches Lean v4.35.0-rc1, which includes
<https://github.com/leanprover/lean4/pull/14996>.
Equations
- Hex.Array.map' f a = (List.map f a.toList).toArray
Instances For
A Vector.map equivalent that reduces in the kernel under the
module system: core Vector.map delegates to Array.map, whose
implementation loop is not exposed, so (v.map f) stalls downstream.
Remove this shim and migrate its callers to core Vector.map when the
pinned toolchain reaches Lean v4.35.0-rc1, alongside
Hex.Array.map'.
Equations
- Hex.Vector.map' f v = Vector.mk (Hex.Array.map' f v.toArray) ⋯
Instances For
Compiled code uses the core Vector.map; the List route
exists only so that the kernel can reduce it.
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. Remove this shim and migrate its callers to
core Array.zipWith when the pinned toolchain reaches Lean
v4.35.0-rc1, which includes
<https://github.com/leanprover/lean4/pull/15078>.
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.