lean4-htt/tests/lean/run/rc_tests.lean
Leonardo de Moura ea6eee516b chore(frontends/lean): use => instead of := in match-expressions
Motivation: use same separator used in lambda expressions as in
other programming languages.
2019-07-04 11:38:38 -07:00

86 lines
1.1 KiB
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.

universes u v
-- setOption pp.binderTypes False
set_option pp.implicit true
set_option trace.compiler.llnf true
-- set_option trace.compiler.boxed true
namespace x1
def f (x : Bool) (y z : Nat) : Nat :=
match x with
| true => y
| false => z + y + y
end x1
namespace x2
def f (x : Nat) : Nat := x
end x2
namespace x3
def f (x y : Nat) : Nat := x
end x3
namespace x4
@[noinline] def h (x y : Nat) : Nat := x + y
def f1 (x y : Nat) : Nat :=
h x y
def f2 (x y : Nat) : Nat :=
h (h x y) (h y x)
def f3 (x y : Nat) : Nat :=
h (h x x) x
def f4 (x y : Nat) : Nat :=
h (h 1 0) x
def f5 (x y : Nat) : Nat :=
h (h 1 1) x
end x4
namespace x5
def myMap {α : Type u} {β : Type v} (f : α → β) : List α → List β
| [] := []
| (x::xs) := f x :: myMap xs
end x5
namespace x6
@[noinline] def act : State Nat Unit :=
modify (fun a => a + 1)
def f : State Nat Unit :=
act *> act
end x6
namespace x7
inductive S
| v1 | v2 | v3
def foo : S → S × S
| S.v1 := (S.v2, S.v1)
| S.v2 := (S.v3, S.v2)
| S.v3 := (S.v1, S.v2)
end x7
namespace x8
def f (x : Nat) : List Nat :=
x :: x :: []
end x8