mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 16:25:54 +03:00
23 lines
414 B
Plaintext
23 lines
414 B
Plaintext
Parser.text
|
|
: ∀(text: String) (Parser Unit)
|
|
= λtext
|
|
(Parser.skip
|
|
Unit
|
|
(Parser.bind
|
|
Bool
|
|
Unit
|
|
(Parser.test text)
|
|
λsuccess
|
|
(Bool.if
|
|
success
|
|
(Parser Unit)
|
|
(Parser.bind
|
|
String
|
|
Unit
|
|
(Parser.take (String.length text))
|
|
λx (Parser.pure Unit Unit.one)
|
|
)
|
|
(Parser.fail Unit "error")
|
|
)
|
|
)
|
|
) |