Even though #114 made it possible to use the same single-error syntax that the rest of the project uses, ParsecT (from parsec) doesn't allow direct access to the Monad it transforms
ParsecT (from megaparsec) allows a custom error type. This won't allow the fail-fast semantics of transforming an error-handling Monad, but ParsecT could be used with CompilerMessage as the error type and Identity as the Monad. Then an instance of ErrorContextM (recently split off from CompileErrorM) could be created for ParsecT CompilerMessage s Identity so that ??> (etc.) can be used during parsing.
The downside is that it adds a few more transitive dependencies, although they don't seem excessive.
Even though #114 made it possible to use the same single-error syntax that the rest of the project uses,
ParsecT
(fromparsec
) doesn't allow direct access to theMonad
it transformsParsecT
(frommegaparsec
) allows a custom error type. This won't allow the fail-fast semantics of transforming an error-handlingMonad
, butParsecT
could be used withCompilerMessage
as the error type andIdentity
as theMonad
. Then aninstance
ofErrorContextM
(recently split off fromCompileErrorM
) could be created forParsecT CompilerMessage s Identity
so that??>
(etc.) can be used during parsing.The downside is that it adds a few more transitive dependencies, although they don't seem excessive.