Skip to content

Possibly implement a funtion to exit for PsuedoExceptions #21

@bbarker

Description

@bbarker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions