-
Notifications
You must be signed in to change notification settings - Fork 82
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
Allow custom error types in monad wrappers #178
Comments
Yeah this looks good to me, and something I'd want too. I thought some of the wrappers might affect the error type, but no they don't, only If you make a PR for this I'd be happy to merge it! |
I'm happy to make a PR for this but I'd be curious what we do with the line in question: AlexError ((AlexPn _ line column),_,_,_) -> alexError $ "lexical error at line " ++ (show line) ++ ", column " ++ (show column) Any ideas on what would be best here? |
What if we did something like Megaparsec where there is a concrete error type plus an additional optional error type:
Then if you don't want a custom error you can do |
@Boarders : Still up to a PR? |
@andreasabel I'll start having a look in the next couple of weeks! |
Sorry I had intended to work on this but was blocked by #195 |
Just to know, is this abandoned? |
I want to extract the position information on lexing errors so I can send them to an LSP client, but the error type for the wrappers is hard coded to be string, so it is difficult to send along that extra information.
As far as I can tell, the change would mostly consist of replacing
Either String a
withEither err a
, adding a corresponding type parameter toAlex a
and adjusting the lineThe text was updated successfully, but these errors were encountered: