lean4-htt/tests/lean/run/parray1.lean
2021-12-02 17:17:55 -08:00

15 lines
367 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 Std.Data.PersistentArray
def check [BEq α] (as : List α) : Bool :=
as.toPersistentArray.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