Allow custom error types in monad wrappers
Open
feature request
wrapper
- Dominant language
- Haskell
- Stars
- 323
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Description
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` with `Either err a`, adding a corresponding type parameter to `Alex a` and adjusting the line
```
AlexError ((AlexPn _ line column),_,_,_) -> alexError $ "lexical error at line " ++ (show line) ++ ", column " ++ (show column)
```
1. Is there an easier way to do this?
2. Am I missing some problems with this approach?
Contributor guide
Assessment
This issue has not been assessed yet.