mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 17:56:48 +03:00
11 lines
291 B
Plaintext
11 lines
291 B
Plaintext
Parser.map
|
|
: ∀(A: *)
|
|
∀(B: *)
|
|
∀(f: ∀(a: A) B)
|
|
∀(p: (Parser A))
|
|
(Parser B)
|
|
= λA λB λf λp λcode
|
|
let P = λx(Parser.Result B)
|
|
let done = λcode λvalue (Parser.Result.done B code (f value))
|
|
let fail = λerror (Parser.Result.fail B error)
|
|
(~(p code) P done fail) |