mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 17:25:31 +03:00
15 lines
345 B
Plaintext
15 lines
345 B
Plaintext
// Removes the last element
|
|
List.begin
|
|
: ∀(A: *)
|
|
∀(list: (List A))
|
|
(List A)
|
|
= λA λlist
|
|
let P = λx(List A)
|
|
let cons = λx0 λxs
|
|
let P = λx(List A)
|
|
let cons = λx1 λxs (List.cons A x0 (List.begin A (List.cons A x1 xs)))
|
|
let nil = (List.nil A)
|
|
(~xs P cons nil)
|
|
let nil = (List.nil A)
|
|
(~list P cons nil)
|