character
This module contains many parsers to do with reading one or more characters. Almost every parser will need something from this module.
This module contains many parsers to do with reading one or more characters. Almost every parser will need something from this module.
- Since
2.2.0
Value members
Concrete methods
Reads a character from the input stream and returns it, else fails if the character is not found at the head of the stream.
Reads a character from the input stream and returns it, else fails if the character is not found at the head of the stream.
- Value Params
- c
The character to search for
- Returns
c
if it can be found at the head of the input
Helper function, equivalent to the predicate used by hexDigit. Useful for providing to LanguageDef
Helper function, equivalent to the predicate used by hexDigit. Useful for providing to LanguageDef
Helper function, equivalent to the predicate used by octDigit. Useful for providing to LanguageDef
Helper function, equivalent to the predicate used by octDigit. Useful for providing to LanguageDef
Helper function, equivalent to the predicate used by space. Useful for providing to LanguageDef
Helper function, equivalent to the predicate used by space. Useful for providing to LanguageDef
Helper function, equivalent to the predicate used by whitespace. Useful for providing to LanguageDef
Helper function, equivalent to the predicate used by whitespace. Useful for providing to LanguageDef
As the dual of oneOf
, noneOf(cs)
succeeds if the current character is not in the supplied
set of characters cs
. Returns the parsed character.
As the dual of oneOf
, noneOf(cs)
succeeds if the current character is not in the supplied
set of characters cs
. Returns the parsed character.
As the dual of oneOf
, noneOf(cs)
succeeds if the current character is not in the supplied
sequence of characters cs
. Returns the parsed character.
As the dual of oneOf
, noneOf(cs)
succeeds if the current character is not in the supplied
sequence of characters cs
. Returns the parsed character.
oneOf(cs)
succeeds if the current character is in the supplied set of characters cs
.
Returns the parsed character. See also satisfy
.
oneOf(cs)
succeeds if the current character is in the supplied set of characters cs
.
Returns the parsed character. See also satisfy
.
oneOf(cs)
succeeds if the current character is in the supplied sequence of characters cs
.
Returns the parsed character. See also satisfy
.
oneOf(cs)
succeeds if the current character is in the supplied sequence of characters cs
.
Returns the parsed character. See also satisfy
.
Reads a character from the head of the input stream if and only if it satisfies the given predicate. Else it fails without consuming the character.
Reads a character from the head of the input stream if and only if it satisfies the given predicate. Else it fails without consuming the character.
- Value Params
- f
The function to test the character on
- Returns
c
iff(c)
is true.
Reads a string from the input stream and returns it, else fails if the string is not found at the head of the stream.
Reads a string from the input stream and returns it, else fails if the string is not found at the head of the stream.
- Value Params
- s
The string to match against
- Returns
s
if it can be found at the head of the input
Concrete fields
Parses a letter or digit. Returns the parsed character.
Parses a letter or digit. Returns the parsed character.
The parser anyChar
accepts any kind of character. Returns the accepted character.
The parser anyChar
accepts any kind of character. Returns the accepted character.
Parses a carriage return character '\r' followed by a newline character '\n', returns the newline character.
Parses a carriage return character '\r' followed by a newline character '\n', returns the newline character.
Parses a CRLF or LF end-of-line. Returns a newline character ('\n').
Parses a CRLF or LF end-of-line. Returns a newline character ('\n').
Parses a hexadecimal digit. Returns the parsed character.
Parses a hexadecimal digit. Returns the parsed character.
Parses a lower case letter. Returns the parsed character.
Parses a lower case letter. Returns the parsed character.
Parses a newline character ('\n'). Returns a newline character.
Parses a newline character ('\n'). Returns a newline character.
Parses an octal digit. Returns the parsed character.
Parses an octal digit. Returns the parsed character.
Parses a whitespace character (either ' ' or '\t'). Returns the parsed character.
Parses a whitespace character (either ' ' or '\t'). Returns the parsed character.
Skips zero or more whitespace characters. See also skipMany
. Uses space.
Skips zero or more whitespace characters. See also skipMany
. Uses space.
Parses a tab character ('\t'). Returns a tab character.
Parses a tab character ('\t'). Returns a tab character.
Parses an upper case letter. Returns the parsed character.
Parses an upper case letter. Returns the parsed character.
Parses a whitespace character (' ', '\t', '\n', '\r', '\f', '\v'). Returns the parsed character.
Parses a whitespace character (' ', '\t', '\n', '\r', '\f', '\v'). Returns the parsed character.