Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracing-megaparsec #500

Open
yaitskov opened this issue Dec 6, 2022 · 3 comments
Open

tracing-megaparsec #500

yaitskov opened this issue Dec 6, 2022 · 3 comments

Comments

@yaitskov
Copy link

yaitskov commented Dec 6, 2022

Hi,

I saw there is Text.Megaparsec.Debug. It has same problem as manual printf - it is expensive to add log statements, to keep them and remove, because it requires manual labor.

Parser built with the library is not transparent enough for debugging.
Transparency is expensive for production.

I would like to have automatic tracer capability. All combinators log name (type, char expected), current position and a few chars from input before attempt to parse into additional state field which is return together with error.

Overhead for production is solved by locating all combinators with tracing capability into separate cabal package, let say tracing-megaparsec. Then it is easy to flip package in cabal with flag and select failing test to run.

@mrkkrp
Copy link
Owner

mrkkrp commented Dec 7, 2022

Well, you are certainly welcome to write such a package!

@yaitskov
Copy link
Author

yaitskov commented Dec 7, 2022

Parsec/Megaparsec have long history. Am I going to be the first in such attempt?

@mrkkrp
Copy link
Owner

mrkkrp commented Dec 8, 2022

I'm not aware of anything like this already existing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants