HarmTrace-Base-1.0.0.2: Parsing and unambiguously representing musical chords.

Portabilitynon-portable
Stabilityexperimental
Maintainerbas@chordify.net, dreixel@chordify.net
Safe HaskellNone

HarmTrace.Base.Parsing

Contents

Description

Summary: Some general parsing utilities used for parsing textual chord representations.

Synopsis

Top level parsers

parseData :: (ListLike s a, Show a) => P (Str a s LineColPos) b -> s -> bSource

Toplevel 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

Toplevel 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 -> bSource

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 StringSource

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.