lean4-htt/tests/lean/notation2.lean
2017-05-25 18:24:16 -07:00

5 lines
267 B
Text

--
inductive List (T : Type) : Type | nil {} : List | cons : T → List → List open List notation h :: t := cons h t notation `[` l:(foldr `,` (h t, cons h t) nil) `]` := l
infixr `::` := cons
#check (1:nat) :: 2 :: nil
#check (1:nat) :: 2 :: 3 :: 4 :: 5 :: nil