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

Add Error-like effect without Catch #389

Open
googleson78 opened this issue Nov 5, 2020 · 1 comment
Open

Add Error-like effect without Catch #389

googleson78 opened this issue Nov 5, 2020 · 1 comment

Comments

@googleson78
Copy link
Member

Let's generalise Fail to be

newtype Fail e m a = Fail e

instead.

My motivation is that I need to have custom types for failures, but I'm never going to be Catching, so I don't want to bother with handling that in my code, and so Error is not very useful.

@KingoftheHomeless
Copy link
Collaborator

Fail's not the right fit for that. Fail's purpose is to provide the MonadFail instance of Sem; nothing else.
However, I could consider the addition of a new effect:

newtype Abort e m a where
  Abort :: e -> Abort e m a

(modulo naming)

@KingoftheHomeless KingoftheHomeless changed the title Let's generalise Fail Add Error effect without Catch Nov 6, 2020
@KingoftheHomeless KingoftheHomeless changed the title Add Error effect without Catch Add Error-like effect without Catch Nov 6, 2020
@isovector isovector mentioned this issue Oct 19, 2021
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

Successfully merging a pull request may close this issue.

2 participants