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

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 a Source #

A decimal digit.

natural :: Integral a => GenParser Char state a Source #

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

integer :: Integral a => GenParser Char state a Source #

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

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

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

parseM :: MonadError m => (ParseError -> ErrorType m) -> GenParser t () a -> String -> [t] -> m a Source #

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.)