lean4-htt/tests/lean/io_bug1.lean

23 lines
416 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
open io
def bar : io unit :=
do put_str "one", put_str "two", put_str "three"
#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"
#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"
#eval foo2 3