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