lean4-htt/tests/playground/unsafe.lean
Leonardo de Moura c46608ced5 feat(library/init/io): implement unsafeIO in Lean
Motivation: avoid closure allocation.
2019-05-11 16:28:11 -07:00

5 lines
161 B
Text

unsafe def test (x : Nat) : Option Nat :=
unsafeIO (IO.println x *> pure (x+1))
unsafe def main (xs : List String) : IO Unit :=
IO.println $ test xs.head.toNat