2014-09-06 18:05:07 +00:00
|
|
|
import data.num
|
|
|
|
|
|
|
|
section
|
2014-10-09 14:13:06 +00:00
|
|
|
variable {A : Type}
|
2014-09-06 18:05:07 +00:00
|
|
|
definition f (a b : A) := a
|
|
|
|
infixl `◀`:65 := f
|
2014-10-09 14:13:06 +00:00
|
|
|
variables a b : A
|
2014-09-06 18:05:07 +00:00
|
|
|
check a ◀ b
|
|
|
|
end
|
|
|
|
|
|
|
|
inductive list (T : Type) : Type :=
|
2015-02-26 01:00:10 +00:00
|
|
|
| nil {} : list T
|
|
|
|
| cons : T → list T → list T
|
2014-09-06 18:05:07 +00:00
|
|
|
|
|
|
|
namespace list
|
|
|
|
section
|
2014-10-09 14:13:06 +00:00
|
|
|
variable {T : Type}
|
2014-09-06 18:05:07 +00:00
|
|
|
notation `[` l:(foldr `,` (h t, cons h t) nil) `]` := l
|
2015-10-13 22:39:03 +00:00
|
|
|
check [(10:num), 20, 30]
|
2014-09-06 18:05:07 +00:00
|
|
|
end
|
|
|
|
end list
|
|
|
|
|
|
|
|
open list
|
2015-10-13 22:39:03 +00:00
|
|
|
check [(10:num), 20, 40]
|
|
|
|
check (10:num) ◀ 20
|