Skip to content

IO's Alternative, MonadPlus, and MonadFail instances leak exceptions #1

Open
@shajra

Description

I could remove the MonadFail instance from Checked, but MonadPlus and Alternative are unfortunate to remove. Really, the problem isn't these type classes. The problem is that IO throws exceptions in the instances for these type classes.

So maybe for IO, I should make a newtype. If you use IO directly, then the warning is merely not to call mzero or fail. But if you use the newtype I provide for IO, then you're safer, because I won't expose exception-throwing instances for any type classes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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