transformers-either-0.1.1: An Either monad transformer

Safe HaskellSafe
LanguageHaskell98

Control.Monad.Trans.Either.Exit

Synopsis

Documentation

orDie :: (e -> Text) -> EitherT e IO a -> IO a Source #

orDieWithCode with an exit code of 1 in case of an error

orDieWithCode :: Int -> (e -> Text) -> EitherT e IO a -> IO a Source #

An idiom for failing hard on EitherT errors.

  • This really dies*. There is no other way to say it.

The reason it lives with command line parser tooling, is that it is the only valid place to actually exit like this. Be appropriately wary.