lean4-htt/tests/lean/run/frontend1.lean
2019-12-11 09:40:46 -08:00

45 lines
1,004 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 Init.Lean.Elab
open Lean
open Lean.Elab
def run (input : String) : MetaIO Unit :=
do env ← MetaIO.getEnv;
opts ← MetaIO.getOptions;
let (env, messages) := process input env opts;
messages.toList.forM $ fun msg => IO.println msg;
when messages.hasErrors $ throw (IO.userError "errors have been found");
pure ()
def M := IO Unit
-- set_option trace.Elab.app true
-- set_option trace.Elab true
#eval run
"universe u universe v
section namespace foo.bla end bla end foo
variable (p q : Prop)
variable (_ b : _)
variable {α : Type}
variable {m : Type → Type}
variable [Monad m]
#check m
#check Type
#check Prop
#check id Nat.zero (α := Nat)
#check id _ (α := Nat)
#check id Nat.zero
#check id (α := Nat)
#check @id Nat
#check p
#check α
#check Nat.succ
#check Nat.add
#check id
#check forall (α : Type), αα
#check (α : Type) → αα
#check {α : Type} → {β : Type} → M → (α → β) → α → β
#check ()
#check run
end"