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

Report multiple errors in Alex monad #144

Open
gustavoaca1997 opened this issue Oct 1, 2019 · 0 comments
Open

Report multiple errors in Alex monad #144

gustavoaca1997 opened this issue Oct 1, 2019 · 0 comments

Comments

@gustavoaca1997
Copy link

gustavoaca1997 commented Oct 1, 2019

Alexis defined as

newtype Alex a = Alex { unAlex :: AlexState
-> Either String (AlexState, a) }

where any error is stored in the Left as String. It would be great if the programmer could define its own "error state" or maybe if Alex could already report more than one lexical error. I had to define my AlexUserState as

data AlexUserState = AlexUserState {
    matches :: Either [Error] [Token]
}

for storing all lexical errors that have occurred and then show them to the user.

@gustavoaca1997 gustavoaca1997 changed the title Allow custom type for error state in Alex monad Report multiple errors at the same time Oct 3, 2019
@gustavoaca1997 gustavoaca1997 changed the title Report multiple errors at the same time Allow custom type for error state in Alex monad Oct 3, 2019
@gustavoaca1997 gustavoaca1997 changed the title Allow custom type for error state in Alex monad Allow custom errors in Alex monad Oct 3, 2019
@gustavoaca1997 gustavoaca1997 changed the title Allow custom errors in Alex monad Allow multiple errors in Alex monad Oct 3, 2019
@gustavoaca1997 gustavoaca1997 changed the title Allow multiple errors in Alex monad Report multiple errors in Alex monad Oct 3, 2019
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

1 participant