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

Pass the validation to MonadFail? #112

Open
KommuSoft opened this issue Jun 3, 2023 · 1 comment
Open

Pass the validation to MonadFail? #112

KommuSoft opened this issue Jun 3, 2023 · 1 comment

Comments

@KommuSoft
Copy link

A (simple) usecase could be to check if the item is valid, and if not fail with the (list) of errors.

So something as:

validateFail :: MonadFail m => a -> m a
validateFail = either fail pure . prettyValidate

A simple use case for this would be m ~ Q for example: a QuasiQuoter where we want to raise a compile error if the quasi quoted value has some invalid properties.

@NorfairKing
Copy link
Owner

LGTM, PR welcome

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

2 participants