Parse a newline character.
Modulemegaparsec-9.8.3Haskell2010
Text.Megaparsec.Char
Commonly used character parsers.
- 32 values
- Packagemegaparsec-9.8.3
- Exports32
- LanguageHaskell2010
- LicenceBSD-2-Clause
- SourceChar.hs
Simple parsers
8 declarationsParse a carriage return character followed by a newline character. Return the sequence of characters parsed.
Parse a tab character.
Like space, but does not accept newlines and carriage returns.
Like space1, but does not accept newlines and carriage returns.
Categories of characters
20 declarationsParse a control character (a non-printing character of the Latin-1 subset of Unicode).
Parse a Unicode space character, and the control characters: tab, newline, carriage return, form feed, and vertical tab.
Parse an upper-case or title-case alphabetic Unicode character. Title case is used by a small number of letter ligatures like the single-character form of Lj.
Parse a lower-case alphabetic Unicode character.
Parse an alphabetic Unicode character: lower-case, upper-case, or title-case letter, or a letter of case-less scripts/modifier letter.
Parse an alphabetic or numeric digit Unicode character.
Note that the numeric digits outside the ASCII range are parsed by this parser but not by digitChar. Such digits may be part of identifiers but are not used by the printer and reader to represent numbers.
Parse a printable Unicode character: letter, number, mark, punctuation, symbol, or space.
Parse an ASCII digit, i.e. between “0” and “9”.
Parse a binary digit, i.e. "0" or "1".
Parse an octal digit, i.e. between “0” and “7”.
Parse a hexadecimal digit, i.e. between “0” and “9”, or “a” and “f”, or “A” and “F”.
Parse a Unicode mark character (accents and the like), which combines with preceding characters.
Parse a Unicode numeric character, including digits from various scripts, Roman numerals, etc.
Parse a Unicode punctuation character, including various kinds of connectors, brackets, and quotes.
Parse a Unicode symbol character, including mathematical and currency symbols.
Parse a Unicode space or separator character.
Parse a character from the first 128 characters of the Unicode character set, corresponding to the ASCII character set.
Parse a character from the first 256 characters of the Unicode character set, corresponding to the ISO 8859-1 (Latin-1) character set.
charCategory cat parses a character in the Unicode General Category
cat; see GeneralCategory.
Return the human-readable name of a Unicode General Category.
Single character
2 declarationsA type-constrained version of single.
semicolon = char ';'The same as char but case-insensitive. This parser returns the actually parsed character preserving its case.
parseTest (char' 'e') "E"'E'parseTest (char' 'e') "G"1:1:unexpected 'G'expecting 'E' or 'e'
Sequence of characters
2 declarationsA synonym for chunk.
The same as string, but case-insensitive. On success returns the string cased as the parsed input.
parseTest (string' "foobar") "foObAr""foObAr"