lean4-htt/src/Init/Data/Slice
Paul Reichert 2980155f5c
refactor: simplify ToIterator (#11242)
This PR significantly changes the signature of the `ToIterator` type
class. The obtained iterators' state is no longer dependently typed and
is an `outParam` instead of being bundled inside the class. Among other
benefits, `simp` can now rewrite inside of `Slice.toList` and
`Slice.toArray`. The downside is that we lose flexibility. For example,
the former combinator-based implementation of `Subarray`'s iterators is
no longer feasible because the states are dependently typed. Therefore,
this PR provides a hand-written iterator for `Subarray`, which does not
require a dependently typed state and is faster than the previous one.

Converting a family of dependently typed iterators into a simply typed
one using a `Sigma`-state iterator generates forbiddingly bad code, so
that we do provide such a combinator. This PR adds a benchmark for this
problem.
2025-11-22 12:37:18 +00:00
..
Array refactor: simplify ToIterator (#11242) 2025-11-22 12:37:18 +00:00
List refactor: simplify ToIterator (#11242) 2025-11-22 12:37:18 +00:00
Array.lean chore: remove public section from end of files (#10684) 2025-10-06 13:30:48 +00:00
Basic.lean feat: make private the default in module (#9044) 2025-06-28 16:30:53 +00:00
Lemmas.lean refactor: simplify ToIterator (#11242) 2025-11-22 12:37:18 +00:00
List.lean feat: List slices (#11019) 2025-11-14 11:33:25 +00:00
Notation.lean refactor: replace PRange shape α with Rcc α and eight other types (#10319) 2025-10-02 06:45:11 +00:00
Operations.lean refactor: simplify ToIterator (#11242) 2025-11-22 12:37:18 +00:00