lean4-htt/tests/lean/io_bug1.lean

22 lines
412 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 system.io
def bar : io unit :=
do put_str "one", put_str "two", put_str "three"
vm_eval bar
print "---------"
def foo : → io unit
| 0 := put_str "at zero\n"
| (n+1) := do put_str "in\n", foo n, put_str "out\n"
vm_eval foo 3
print "---------"
def foo2 : → io unit
| 0 := put_str "at zero\n"
| (n+1) := do put_str "in\n", foo2 n, put_str "out\n", put_str "out2\n"
vm_eval foo2 3