2014-01-05 20:05:08 +00:00
|
|
|
variable T : Type
|
|
|
|
variable R : Type
|
|
|
|
variable t2r : T -> R
|
|
|
|
coercion t2r
|
|
|
|
variable g : R -> R -> R
|
|
|
|
variable a : T
|
2014-01-05 19:03:35 +00:00
|
|
|
print g a a
|
2014-01-05 20:05:08 +00:00
|
|
|
variable b : R
|
2014-01-05 19:03:35 +00:00
|
|
|
print g a b
|
|
|
|
print g b a
|
2014-01-05 20:05:08 +00:00
|
|
|
setoption lean::pp::coercion true
|
2014-01-05 19:03:35 +00:00
|
|
|
print g a a
|
|
|
|
print g a b
|
|
|
|
print g b a
|
2014-01-05 20:05:08 +00:00
|
|
|
setoption lean::pp::coercion false
|
|
|
|
variable S : Type
|
|
|
|
variable s : S
|
|
|
|
variable r : S
|
|
|
|
variable h : S -> S -> S
|
|
|
|
infixl 10 ++ : g
|
|
|
|
infixl 10 ++ : h
|
|
|
|
setoption lean::pp::notation false
|
2014-01-05 19:03:35 +00:00
|
|
|
print a ++ b ++ a
|
|
|
|
print r ++ s ++ r
|
2014-01-05 20:05:08 +00:00
|
|
|
check a ++ b ++ a
|
|
|
|
check r ++ s ++ r
|
|
|
|
setoption lean::pp::coercion true
|
2014-01-05 19:03:35 +00:00
|
|
|
print a ++ b ++ a
|
|
|
|
print r ++ s ++ r
|
2014-01-05 20:05:08 +00:00
|
|
|
setoption lean::pp::notation true
|
2014-01-05 19:03:35 +00:00
|
|
|
print a ++ b ++ a
|
|
|
|
print r ++ s ++ r
|