WithError is solid, but sometimes branches are missed and lead to very ugly errors. Furthermore, due to the intricacies of Maybe, we can get some very weird errors - which of the parts of the parser should error in Maybe a -> Maybe b -> c -> ... if neither of the Maybes are present?
This needs some discussion, but thoughts that came up were:
- Default errors for parts of the SmartParser - i.e. a
Text should default error with error: expecting Text that should be overridden.
- "maybe you meant one of:" seems to be... not very clear most of the time.
- Try to avoid "unknown error" as much as possible - maybe plugins should have a default "error in x plugin"?
I think the system of using parser names is probably unreliable (we name parsers with their error messages using <?> and slightly change the reporting system to make it clearer to users) - maybe there's other stuff in megaparsec that can help with error parsing? This needs some serious investigation, regardless.
WithErroris solid, but sometimes branches are missed and lead to very ugly errors. Furthermore, due to the intricacies ofMaybe, we can get some very weird errors - which of the parts of the parser should error inMaybe a -> Maybe b -> c -> ...if neither of theMaybes are present?This needs some discussion, but thoughts that came up were:
Textshould default error witherror: expecting Textthat should be overridden.I think the system of using parser names is probably unreliable (we name parsers with their error messages using
<?>and slightly change the reporting system to make it clearer to users) - maybe there's other stuff inmegaparsecthat can help with error parsing? This needs some serious investigation, regardless.