lean4-htt/tests/lean/run/equation_with_values.lean
Leonardo de Moura a0a8103804 chore(frontends/lean): go back to 'c' as notation for characters
This suggestion has been discussed at Slack.
We have decided to use #"c" as notation because we wanted to allow `'`
in the beginning of identifiers like in SML and F*. In particular,
we wanted to allow users to use 'a 'b 'c for naming type parameters
like in SML. However, nobody used this notation. In the Lean standard
library, we are using greek letters for naming type parameters.
So, there is no real motivation for the ugly #"c" syntax.
2017-05-02 13:00:51 -07:00

51 lines
940 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 f : char → nat
| 'a' := 0
| 'b' := 1
| 'c' := 2
| 'd' := 3
| 'e' := 4
| _ := 5
#check f.equations._eqn_1
#check f.equations._eqn_2
#check f.equations._eqn_3
#check f.equations._eqn_4
#check f.equations._eqn_5
#check f.equations._eqn_6
def g : nat → nat
| 100000 := 0
| 200000 := 1
| 300000 := 2
| 400000 := 3
| _ := 5
#check g.equations._eqn_1
#check g.equations._eqn_2
#check g.equations._eqn_3
#check g.equations._eqn_4
#check g.equations._eqn_5
def h : string → nat
| "hello" := 0
| "world" := 1
| "bla" := 2
| "boo" := 3
| _ := 5
#check h.equations._eqn_1
#check h.equations._eqn_2
#check h.equations._eqn_3
#check h.equations._eqn_4
#check h.equations._eqn_5
def r : string × string → nat
| ("hello", "world") := 0
| ("world", "hello") := 1
| _ := 2
#check r.equations._eqn_1
#check r.equations._eqn_2
#check r.equations._eqn_3
#check r.equations._eqn_4
#check r.equations._eqn_5