r/purescript • u/LukaJCB • Apr 16 '18
Rethinking MonadError
https://lukajcb.github.io/blog/functional/2018/04/15/rethinking-monaderror.html
5
Upvotes
r/purescript • u/LukaJCB • Apr 16 '18
View all comments
2
u/natefaubion Apr 16 '18
I've been thinking about this some as well wrt a Bifunctor Aff and
purescript-checked-exceptions. Some sort ofBimonad(essentially your second solution) was what I arrived at, but the structural restrictions (and lack of quantified constraints in PS) is a clear disadvantage. My use case is more refining the error type (so using something like IO and UIO is not an option). I just want to do a type-changing catch over the error type but keep the same underlying Monad. Can theMonadBlunderclass encapsulate that?