elm/parser
Regular expressions are quite confusing and difficult to use. This library provides a coherent alternative that handles more cases and produces clearer code.
type alias Point =
{ x : Float
, y : Float
}
point : Parser Point
point =
succeed Point
|. symbol "("
|. spaces
|= float
|. spaces
|. symbol ","
|. spaces
|= float
|. spaces
|. symbol ")"
Function | Description |
Runs the Parser on a String | |
Parser for Int | |
Parser for Float | |
Trys different Parsers. Uses the first that succeeds. Once the parser matches the first element, there is no going back! | |
Applys the first parser and if successful applies the second. Fails if one of the parsers fails. |
Function | Description |
Starts the Pipeline. a -> Parser a is the constructor.For a record Point use the structur called Point . | |
Keeps an element. | |
Eats a character and throws it away. | |
Represents whitespace |
Function | Description |
Looks for zero or more characters that succeeds the check. Stops as soon as the check fails. | |
Reads one symbols. | |
Returnes the string that got chomped |
Function | Description |
Returns the error message and ends the parsing. The argument is the actuall message. |
Last modified 3yr ago