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
Show parent comment
2
u/natefaubion Apr 16 '18
I also think this class is interesting because it's similar in spirit to the
Parallelclass in PureScript.I think I can answer my own question, in that the idea is to basically have a representation that mirrors ExceptT, where the unexceptional type just reflects the error in an Either. So in the case of Bifunctor Aff, you could have
newtype UAff a = UAff (forall void. Aff void a). And changing the error type amount to rethrowing the Either in the exceptional type.