mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 20:47:25 +03:00
11 lines
327 B
Plaintext
11 lines
327 B
Plaintext
Parser.bind
|
|
: ∀(A: *)
|
|
∀(B: *)
|
|
∀(a: (Parser A))
|
|
∀(b: ∀(x: A) (Parser B))
|
|
(Parser B)
|
|
= λA λB λa λb λcode
|
|
let P = λx ∀(b: ∀(x: A) (Parser B)) (Parser.Result B)
|
|
let done = λa.code λa.value λb (b a.value a.code)
|
|
let fail = λa.error λb (Parser.Result.fail B a.error)
|
|
(~(a code) P done fail b) |