require-0.4.9: Scrap your qualified import clutter

Safe HaskellNone
LanguageHaskell2010

Require.Parser

Synopsis

Documentation

parseMaybe :: (Ord e, Stream s) => Parsec e s a -> s -> Maybe a #

parseMaybe p input runs the parser p on input and returns the result inside Just on success and Nothing on failure. This function also parses eof, so if the parser doesn't consume all of its input, it will fail.

The function is supposed to be useful for lightweight parsing, where error messages (and thus file names) are not important and entire input should be parsed. For example, it can be used when parsing of a single number according to a specification of its format is desired.