I recently had (possibly good) cause to have a function like this:
seOrExit :: SX.SomeException -> SomeNonPseudoException
seOrExit e = case SX.fromException e of
Just se -> se
Nothing ->
unsafePerformIO $ SE.die "Received a PseudoException, exiting! "
The context is that I can use seOrExit with a mapError that works on my monad transformer stack that is built on top of UIO.
If you're chugging along, and get a psuedo exception, I'm not sure what else there is to be done about it anyway, other than performing an alternative form of logging.
Anyway, wanted to get your thoughts on this use case. Maybe this is terrible.
I recently had (possibly good) cause to have a function like this:
The context is that I can use seOrExit with a
mapErrorthat works on my monad transformer stack that is built on top of UIO.If you're chugging along, and get a psuedo exception, I'm not sure what else there is to be done about it anyway, other than performing an alternative form of logging.
Anyway, wanted to get your thoughts on this use case. Maybe this is terrible.