lean4-htt/tests/lean/run/newfrontend1.lean
2020-01-13 16:20:34 -08:00

42 lines
633 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.

def x := 1
new_frontend
#check x
variables {α : Type}
def f (a : α) : α :=
a
def tst (xs : List Nat) : Nat :=
xs.foldl (init := 10) (· + ·)
#check tst [1, 2, 3]
#check tst
#check (fun stx => if True then let e := stx; HasPure.pure e else HasPure.pure stx : Nat → Id Nat)
#check let x : Nat := 1; x
def foo (a : Nat) (b : Nat := 10) (c : Bool := Bool.true) : Nat :=
a + b
set_option pp.all true
#check foo 1
#check foo 3 (c := false)
def Nat.boo (a : Nat) :=
succ a -- succ here is resolved as `Nat.succ`.
#check Nat.boo
#check true
-- apply is still a valid identifier name
def apply := "hello"
#check apply