lean4-htt/tests/lean/run/parray1.lean
Kim Morrison 16bd7ea455
chore: deprecate List.iota (#6708)
This PR deprecates `List.iota`, which we make no essential use of. `iota
n` can be replaced with `(range' 1 n).reverse`. The verification lemmas
for `range'` already have better coverage than those for `iota`.
Any downstream projects using it (I am not aware of any) are encouraged
to adopt it.
2025-01-21 02:32:35 +00:00

17 lines
397 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean.Data.PersistentArray
def check [BEq α] (as : List α) : Bool :=
as.toPArray'.foldr (.::.) [] == as
def tst1 : IO Unit := do
assert! check [1, 2, 3]
assert! check ([] : List Nat)
assert! check (List.range 17)
assert! check (List.range 533)
assert! check (List.range 1000)
assert! check (List.range 2600)
IO.println "done"
/-- info: done -/
#guard_msgs in
#eval tst1