mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 15:56:12 +03:00
12 lines
262 B
Plaintext
12 lines
262 B
Plaintext
Maybe.bind
|
|
: ∀(A: *)
|
|
∀(B: *)
|
|
∀(a: (Maybe A))
|
|
∀(b: ∀(x: A) (Maybe B))
|
|
(Maybe B)
|
|
= λA λB λa λb
|
|
let P = λx ∀(b: ∀(x: A) (Maybe B)) (Maybe B)
|
|
let some = λa.value λb (b a.value)
|
|
let none = λb (Maybe.none B)
|
|
(~a P some none b)
|