Skip to content

Pass the validation to MonadFail? #112

@KommuSoft

Description

@KommuSoft

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions