View Source Chrysopoeia.Combinator (chrysopoeia v0.1.1)

Core combinators.

Link to this section Summary

Functions

Combinator that adds a condition to an existing parser.

Parser that always errors.

Applies fun to the result of parser on success.

Parser that always succeeds, and consumes nothing.

Link to this section Functions

Link to this function

condition(parser, fun, opts \\ [err_msg: "Condition was not met"])

View Source

Combinator that adds a condition to an existing parser.

If fun is true, return the value. Otherwise, return an error. The error message is optional.

Parser that always errors.

Applies fun to the result of parser on success.

Parser that always succeeds, and consumes nothing.