parse-0.1.0.0: Simple way to parse strings with Python-like format strings.
Safe HaskellNone
LanguageHaskell2010

Parse

Synopsis

Documentation

parse :: ParseTuple a => String -> String -> a Source #

Parse str according to the format, and return a tuple of parsed fields. It can fail with an error. Parsable fields in the format string are denoted with "{}", and they will match anything

parseMaybe :: ParseTuple a => String -> String -> Maybe a Source #

Safe variant of parse which returns a Maybe monad instead of failing with an error.

parseEither :: ParseTuple a => String -> String -> Either String a Source #

Safe variant of parse which returns an Either monad instead of failing with an error. The Left (error) constructor carries a String that contains information about the error.

parseList :: String -> String -> [String] Source #

Parse str according to the format, and return a list of parsed fields. It can fail with an error. Parsable fields in the format string are denoted with "{}", and they will match anything until the next block of the format string matches something in str.

parseListMaybe :: String -> String -> Maybe [String] Source #

Safe variant of parseList which returns a Maybe monad instead of failing with an error.

parseListEither :: String -> String -> Either String [String] Source #

Safe variant of parseList which returns an Either monad instead of failing with an error. The Left (error) constructor carries a String that contains information about the error.