You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had (possibly good) cause to have a function like this:
seOrExit::SX.SomeException->SomeNonPseudoException
seOrExit e =caseSX.fromException e ofJust 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.
The text was updated successfully, but these errors were encountered:
If you use unexceptionalid functions to build a stack based on UIO I'm curious how you end up with a SomeException at all? Should always end up with at most a SomeNonPseudoException because PseudoException should not be caught in UIO context.
Due to parseText (being a function from a 3rd party library) possibly returning Left SomeException as part of it's signature, I then needed a function like mapZErrorOrExit :: ZIO r SX.SomeException a -> ZIO r SomeNonPseudoException a to absolve the error as in:
Oh interesting. That's a case I guess I hadn't considered: when a library already catches/returns exceptions but doesn't use anything more specific than SomeException.
I recently had (possibly good) cause to have a function like this:
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.
The text was updated successfully, but these errors were encountered: