mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 20:47:25 +03:00
8 lines
283 B
Plaintext
8 lines
283 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) |