;lib: clarify parser monad transformers a little

[ci skip]
This commit is contained in:
Simon Michael 2019-09-08 10:40:47 -07:00
parent 39635b2fde
commit c7746131fc

View File

@ -49,14 +49,15 @@ type SimpleStringParser a = Parsec CustomErr String a
-- | A parser of strict text to some type. -- | A parser of strict text to some type.
type SimpleTextParser = Parsec CustomErr Text -- XXX an "a" argument breaks the CsvRulesParser declaration somehow type SimpleTextParser = Parsec CustomErr Text -- XXX an "a" argument breaks the CsvRulesParser declaration somehow
-- | A parser of text in some monad. -- | A parser of text that runs in some monad.
type TextParser m a = ParsecT CustomErr Text m a type TextParser m a = ParsecT CustomErr Text m a
-- | A parser of text in some monad, with a journal as state. -- | A parser of text that runs in some monad, keeping a Journal as state.
type JournalParser m a = StateT Journal (ParsecT CustomErr Text m) a type JournalParser m a = StateT Journal (ParsecT CustomErr Text m) a
-- | A parser of text in some monad, with a journal as state, that can throw a -- | A parser of text that runs in some monad, keeping a Journal as
-- "final" parse error that does not backtrack. -- state, that can throw an exception to end parsing, preventing
-- further parser backtracking.
type ErroringJournalParser m a = type ErroringJournalParser m a =
StateT Journal (ParsecT CustomErr Text (ExceptT FinalParseError m)) a StateT Journal (ParsecT CustomErr Text (ExceptT FinalParseError m)) a