lean4-htt/tests/lean/run/parray1.lean
2022-09-26 05:46:04 -07:00

15 lines
360 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.iota 17)
assert! check (List.iota 533)
assert! check (List.iota 1000)
assert! check (List.iota 2600)
IO.println "done"
#eval tst1