-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlist.hs
29 lines (26 loc) · 803 Bytes
/
list.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
map =
\ (A : Set) (B : Set) (f : forall (_ : A). B) (xs : List A) ->
elim
(List A)
(\ (_ : List A) -> List B)
(Nil (List B))
(\ (h : A) (t : List A) (rec : List B) -> Cons (List B) (f h) rec )
xs;
append =
\ (a : Set) (xs : List a) (ys : List a) ->
elim
(List a)
(\(_ : List a) -> List a)
ys
(\ (v : a) (vs : List a) (w : List a) -> Cons (List a) v w)
xs;
unit =
\ (A : Set) (x : A) -> Cons (List A) x (Nil (List A));
list_id =
\ (A : Set) (xs : List A) ->
elim
(List A)
(\ (_ : List A) -> List A)
(Nil (List A))
(\ (h : A) (t : List A) (rec : List A) -> Cons (List A) h rec)
xs;