parsec-extra-0.1.0.3: Some miscellaneous basic string parsers.

Safe HaskellSafe-Inferred

Text.Parsec.Extra

Synopsis

Documentation

eol :: GenParser Char state ()Source

Parse "end of line": one of "\n", "\r\n", or "\r".

digit :: Integral a => GenParser Char state aSource

A decimal digit.

natural :: Integral a => GenParser Char state aSource

A natural (i.e. non-negative integer) number, in decimal notation.

integer :: Integral a => GenParser Char state aSource

An integer number, in decimal notation (possibly prefixed with "-").

caseInsensitiveChar :: Char -> GenParser Char state CharSource

Parse the given character, or the same character in another case (upper or lower).

caseInsensitiveString :: String -> GenParser Char state StringSource

Parse the given string, but with any combination of upper and lower case characters.

parseM :: (MonadError m, Error (ErrorType m)) => GenParser t () a -> String -> [t] -> m aSource

Parsing function. Uses the MonadError class to throw a monadic error when parsing fails. (Useful in a stack of monad transformers from the transformers package http://hackage.haskell.org/package/transformers.)