2014-09-06 18:05:07 +00:00
|
|
|
import data.num
|
|
|
|
|
|
|
|
section
|
|
|
|
parameter {A : Type}
|
|
|
|
definition f (a b : A) := a
|
|
|
|
infixl `◀`:65 := f
|
|
|
|
parameters a b : A
|
|
|
|
check a ◀ b
|
|
|
|
end
|
|
|
|
|
|
|
|
inductive list (T : Type) : Type :=
|
|
|
|
nil {} : list T,
|
|
|
|
cons : T → list T → list T
|
|
|
|
|
|
|
|
namespace list
|
|
|
|
section
|
2014-10-02 23:20:52 +00:00
|
|
|
parameter {T : Type}
|
2014-09-06 18:05:07 +00:00
|
|
|
notation `[` l:(foldr `,` (h t, cons h t) nil) `]` := l
|
|
|
|
check [10, 20, 30]
|
|
|
|
end
|
|
|
|
end list
|
|
|
|
|
|
|
|
open list
|
|
|
|
check [10, 20, 40]
|
|
|
|
check 10 ◀ 20
|