| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Parse
Synopsis
- parse :: ParseTuple a => String -> String -> a
- parseMaybe :: ParseTuple a => String -> String -> Maybe a
- parseEither :: ParseTuple a => String -> String -> Either String a
- parseList :: String -> String -> [String]
- parseListMaybe :: String -> String -> Maybe [String]
- parseListEither :: String -> String -> Either String [String]
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.