Moduleparsec1-1.0.0.8Haskell98
Text.ParserCombinators.Parsec.Char
Commonly used character parsers
- 1 type
- 17 values
- Packageparsec1-1.0.0.8
- Exports18
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceChar.hs
Parses an alphabetic or numeric Unicode characters according to isAlphaNum. Returns the parsed character.
This parser succeeds for any character. Returns the parsed character.
char c parses a single character c. Returns the parsed
character (i.e. c).
semiColon = char ';' Parses a digit ('0' ... '9') according to isDigit. Returns the parsed character.
Parses a hexadecimal digit (a digit or a letter between 'a' and 'f' or 'A' and 'F'). Returns the parsed character.
Parses an alphabetic Unicode characters according to isAlpha. Returns the parsed character.
Parses a lower case character according to isLower. Returns the parsed character.
Parses a newline character ('\n'). Returns a newline character.
As the dual of oneOf, noneOf cs succeeds if the current
character not in the supplied list of characters cs. Returns the
parsed character.
consonant = noneOf "aeiou" Parses an octal digit ('0' ... '7') according to isOctDigit. Returns the parsed character.
oneOf cs succeeds if the current character is in the supplied
list of characters cs. Returns the parsed character. See also
satisfy.
vowel = oneOf "aeiou" The parser satisfy f succeeds for any character for which the
supplied function f returns True. Returns the character that is
actually parsed.
digit = satisfy isDigit
oneOf cs = satisfy (`elem` cs) Parses a white space character (any character which satisfies isSpace) Returns the parsed character.
Skips zero or more white space characters. See also skipMany.
string s parses a sequence of characters given by s. Returns
the parsed string (i.e. s).
divOrMod = string "div"
<|> string "mod" Parses a tab character ('\t'). Returns a tab character.
Parses an upper case letter according to isUpper. Returns the parsed character.