purescript/purescript-transformers

MonadThrow as superclass for MonadError

natefaubion opened this issue · 1 comments

I found myself needing a MonadThrow e m, without the need for catching, such that throwError e *> m = throwError e. Seems to be in a similar vein as splitting up MonadAsk and MonadTell.

paf31 commented

👍 Yes, I recently found a use case for this too. MonadThrow is useful when you have a MonadTrans but nothing else (so you can't necessarily lift catchError). Another example is something like FreeT, where it's trivial to lift . throwError, but I'm not sure if it's possible/sensible to catch errors.