lean4-htt/tests/lean/run/evalconst.lean
Leonardo de Moura 17b6957f6c chore: fix tests
2020-05-26 15:05:01 -07:00

21 lines
335 B
Text

import Lean
open Lean
def x := 10
unsafe def tst : MetaIO Unit := do
env ← MetaIO.getEnv;
IO.println $ env.evalConst Nat `x;
pure ()
#eval tst
def f (x : Nat) := x + 1
unsafe def tst2 : MetaIO Unit := do
env ← MetaIO.getEnv;
f ← liftM $ IO.ofExcept $ env.evalConst (Nat → Nat) `f;
IO.println $ (f 10);
pure ()
#eval tst2