Kind/book/List.concat.kind2
2024-03-01 20:40:31 -03:00

8 lines
247 B
Plaintext

List.concat
: ∀(T: *) ∀(xs: (List T)) ∀(ys: (List T)) (List T)
= λT λxs λys
let P = λxs ∀(ys: (List T)) (List T)
let cons = λhead λtail λys
(List.cons T head (List.concat T tail ys))
let nil = λys ys
(~xs P cons nil ys)