Copyright | (c) 2012--2016, Chordify BV |
---|---|
License | LGPL-3 |
Maintainer | haskelldevelopers@chordify.net |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Summary: Some general parsing utilities used for parsing textual chord representations.
- parseData :: (ListLike s a, Show a) => P (Str a s LineColPos) b -> s -> b
- parseDataWithErrors :: (ListLike s a, Show a) => P (Str a s LineColPos) b -> s -> (b, [Error LineColPos])
- parseDataSafe :: (ListLike s a, Show a, Show s) => P (Str a s LineColPos) b -> s -> b
- pString :: (ListLike state a, IsLocationUpdatedBy loc a, Show a, Eq a) => [a] -> P (Str a state loc) [a]
- pLineEnd :: Parser String
- pManyTill :: P st a -> P st b -> P st [a]
- module Text.ParserCombinators.UU
- module Text.ParserCombinators.UU.Utils
- module Text.ParserCombinators.UU.BasicInstances
Top level parsers
parseData :: (ListLike s a, Show a) => P (Str a s LineColPos) b -> s -> b Source #
Top-level parser that ignores error-reporting, regardless of there were error in the parse
parseDataWithErrors :: (ListLike s a, Show a) => P (Str a s LineColPos) b -> s -> (b, [Error LineColPos]) Source #
Top-level parser that returns both the result as well as a (possibly empty) list of error-corrections.
parseDataSafe :: (ListLike s a, Show a, Show s) => P (Str a s LineColPos) b -> s -> b Source #
This is identical to parseData
however it will throw an error
when
the the list with parsing errors is not empty. No, this will not make your
program more safe. However, in certain cases you really want to be sure
that parsing has finished without errors. In those cases you should use
parseDataSafe
.
Some general parsers
pString :: (ListLike state a, IsLocationUpdatedBy loc a, Show a, Eq a) => [a] -> P (Str a state loc) [a] Source #
Parses a specific string
pLineEnd :: Parser String Source #
Parses UNIX and DOS/WINDOWS line endings including trailing whitespace
pManyTill :: P st a -> P st b -> P st [a] Source #
Parses an arbitrary times the first parsing combinator until the parsing second parsing combinator is encountered. The result of the second parsing combinator is ignored.
module Text.ParserCombinators.UU