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

Debuggin function RE -> String #28

Closed
nomeata opened this issue Oct 19, 2015 · 3 comments
Closed

Debuggin function RE -> String #28

nomeata opened this issue Oct 19, 2015 · 3 comments

Comments

@nomeata
Copy link

nomeata commented Oct 19, 2015

After creating some rather complex regular expression assembly DSL, in the end I get a pattern match failure, and now I am having a hard time to debug my code. It would be great if RE had a show instance, or maybe some debugShow :: Show s => RE s a -> String function that explains the structure of the regular expression.

@ocharles
Copy link

ocharles commented Nov 8, 2018

I'd love to have this too, but I don't think it's feasible. The fundamental matching primitive in RE is:

    Symbol :: ThreadId -> (s -> Maybe a) -> RE s a

That is, a function mapping tokens to some parsed variation. Thus there's no way to know what the regular expression expects to be able to proceed.

@UnkindPartition
Copy link
Owner

Related: #36

@UnkindPartition
Copy link
Owner

In fact, I think I'm going to close this one in favour of #36, as it is a bit more constructive.

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

No branches or pull requests

3 participants