require-0.4.11: Scrap your qualified import clutter
Safe HaskellSafe-Inferred
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 consumed. For example, it can be used for parsing of a single number according to a specification of its format.