streamly-core-0.1.0: Streaming, parsers, arrays and more
Copyright(c) 2021 Composewell Technologies
LicenseBSD-3-Clause
Maintainerstreamly@composewell.com
Stabilityreleased
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streamly.Unicode.Parser

Description

To parse a text input, use the decode routines from Streamly.Unicode.Stream module to convert an input byte stream to a Unicode Char stream and then use these parsers on the Char stream.

Synopsis

Single Chars

char :: Monad m => Char -> Parser Char m Char Source #

Match a specific character.

charIgnoreCase :: Monad m => Char -> Parser Char m Char Source #

Match a specific character ignoring case.

alpha :: Monad m => Parser Char m Char Source #

Match any character that satisfies isAlpha

alphaNum :: Monad m => Parser Char m Char Source #

Match any character that satisfies isAlphaNum

letter :: Monad m => Parser Char m Char Source #

Match any character that satisfies isLetter

ascii :: Monad m => Parser Char m Char Source #

Match any character that satisfies isAscii

asciiLower :: Monad m => Parser Char m Char Source #

Match any character that satisfies isAsciiLower

asciiUpper :: Monad m => Parser Char m Char Source #

Match any character that satisfies isAsciiUpper

latin1 :: Monad m => Parser Char m Char Source #

Match any character that satisfies isLatin1

lower :: Monad m => Parser Char m Char Source #

Match any character that satisfies isLower

upper :: Monad m => Parser Char m Char Source #

Match any character that satisfies isUpper

mark :: Monad m => Parser Char m Char Source #

Match any character that satisfies isMark

printable :: Monad m => Parser Char m Char Source #

Match any character that satisfies isPrint

punctuation :: Monad m => Parser Char m Char Source #

Match any character that satisfies isPunctuation

separator :: Monad m => Parser Char m Char Source #

Match any character that satisfies isSeparator

space :: Monad m => Parser Char m Char Source #

Match any character that satisfies isSpace

symbol :: Monad m => Parser Char m Char Source #

Match any character that satisfies isSymbol

digit :: Monad m => Parser Char m Char Source #

Match any character that satisfies isDigit

octDigit :: Monad m => Parser Char m Char Source #

Match any character that satisfies isOctDigit

hexDigit :: Monad m => Parser Char m Char Source #

Match any character that satisfies isHexDigit

numeric :: Monad m => Parser Char m Char Source #

Match any character that satisfies isNumber

Char Sequences

string :: Monad m => String -> Parser Char m String Source #

Match the input with the supplied string and return it if successful.

stringIgnoreCase :: Monad m => String -> Parser Char m String Source #

Match the input with the supplied string and return it if successful.

dropSpace :: Monad m => Parser Char m () Source #

Drop zero or more white space characters.

dropSpace1 :: Monad m => Parser Char m () Source #

Drop one or more white space characters.

Digit Sequences (Numbers)

decimal :: (Monad m, Integral a) => Parser Char m a Source #

Parse and decode an unsigned integral decimal number.

hexadecimal :: (Monad m, Integral a, Bits a) => Parser Char m a Source #

Parse and decode an unsigned integral hexadecimal number. The hex digits 'a' through 'f' may be upper or lower case.

Note: This parser does not accept a leading "0x" string.

Modifiers

signed :: (Num a, Monad m) => Parser Char m a -> Parser Char m a Source #

Allow an optional leading '+' or '-' sign character before any parser.