lean4-htt/tests/lean/run/IO2.lean
Leonardo de Moura 3b38f71f11 fix(library,tests/lean): fix run/interactive tests, and problems in the standard library due to the new interpretation for Type
We had to change subtype to use Sort since the axiom
strong_indefinite_description uses it.

see #1341
2017-01-30 11:54:00 -08:00

13 lines
384 B
Text

import system.io
open list
/- B and unit must be in the same universe
So, we must put B at Type₁ or use poly_unit
since unit is at Type₁
-/
definition foreach {A : Type} {B : Type} : list A → (A → io B) → io punit
| [] f := return punit.star
| (x::xs) f := do f x, foreach xs f
vm_eval foreach [1,2,3,4,5] (λ i, do put_str "value: ", put_nat i, put_str "\n")