exitcode-0.1.0.1: Monad transformer for exit codes

Safe HaskellSafe
LanguageHaskell2010

Control.Exitcode

Contents

Synopsis

Types

data ExitcodeT f a Source #

An exit code status where failing with a value `0` cannot be represented.

Transformer for either a non-zero exit code (Int) or a value :: a.

Instances

MMonad ExitcodeT Source # 

Methods

embed :: Monad n => (forall a. m a -> ExitcodeT n a) -> ExitcodeT m b -> ExitcodeT n b #

MonadTrans ExitcodeT Source # 

Methods

lift :: Monad m => m a -> ExitcodeT m a #

MonadRWS r w s f => MonadRWS r w s (ExitcodeT f) Source # 
MonadReader r f => MonadReader r (ExitcodeT f) Source # 

Methods

ask :: ExitcodeT f r #

local :: (r -> r) -> ExitcodeT f a -> ExitcodeT f a #

reader :: (r -> a) -> ExitcodeT f a #

MonadState s f => MonadState s (ExitcodeT f) Source # 

Methods

get :: ExitcodeT f s #

put :: s -> ExitcodeT f () #

state :: (s -> (a, s)) -> ExitcodeT f a #

MonadError e f => MonadError e (ExitcodeT f) Source # 

Methods

throwError :: e -> ExitcodeT f a #

catchError :: ExitcodeT f a -> (e -> ExitcodeT f a) -> ExitcodeT f a #

MonadWriter w f => MonadWriter w (ExitcodeT f) Source # 

Methods

writer :: (a, w) -> ExitcodeT f a #

tell :: w -> ExitcodeT f () #

listen :: ExitcodeT f a -> ExitcodeT f (a, w) #

pass :: ExitcodeT f (a, w -> w) -> ExitcodeT f a #

Monad f => Monad (ExitcodeT f) Source # 

Methods

(>>=) :: ExitcodeT f a -> (a -> ExitcodeT f b) -> ExitcodeT f b #

(>>) :: ExitcodeT f a -> ExitcodeT f b -> ExitcodeT f b #

return :: a -> ExitcodeT f a #

fail :: String -> ExitcodeT f a #

Functor f => Functor (ExitcodeT f) Source # 

Methods

fmap :: (a -> b) -> ExitcodeT f a -> ExitcodeT f b #

(<$) :: a -> ExitcodeT f b -> ExitcodeT f a #

Applicative f => Applicative (ExitcodeT f) Source # 

Methods

pure :: a -> ExitcodeT f a #

(<*>) :: ExitcodeT f (a -> b) -> ExitcodeT f a -> ExitcodeT f b #

liftA2 :: (a -> b -> c) -> ExitcodeT f a -> ExitcodeT f b -> ExitcodeT f c #

(*>) :: ExitcodeT f a -> ExitcodeT f b -> ExitcodeT f b #

(<*) :: ExitcodeT f a -> ExitcodeT f b -> ExitcodeT f a #

Foldable f => Foldable (ExitcodeT f) Source # 

Methods

fold :: Monoid m => ExitcodeT f m -> m #

foldMap :: Monoid m => (a -> m) -> ExitcodeT f a -> m #

foldr :: (a -> b -> b) -> b -> ExitcodeT f a -> b #

foldr' :: (a -> b -> b) -> b -> ExitcodeT f a -> b #

foldl :: (b -> a -> b) -> b -> ExitcodeT f a -> b #

foldl' :: (b -> a -> b) -> b -> ExitcodeT f a -> b #

foldr1 :: (a -> a -> a) -> ExitcodeT f a -> a #

foldl1 :: (a -> a -> a) -> ExitcodeT f a -> a #

toList :: ExitcodeT f a -> [a] #

null :: ExitcodeT f a -> Bool #

length :: ExitcodeT f a -> Int #

elem :: Eq a => a -> ExitcodeT f a -> Bool #

maximum :: Ord a => ExitcodeT f a -> a #

minimum :: Ord a => ExitcodeT f a -> a #

sum :: Num a => ExitcodeT f a -> a #

product :: Num a => ExitcodeT f a -> a #

Traversable f => Traversable (ExitcodeT f) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> ExitcodeT f a -> f (ExitcodeT f b) #

sequenceA :: Applicative f => ExitcodeT f (f a) -> f (ExitcodeT f a) #

mapM :: Monad m => (a -> m b) -> ExitcodeT f a -> m (ExitcodeT f b) #

sequence :: Monad m => ExitcodeT f (m a) -> m (ExitcodeT f a) #

Eq1 f => Eq1 (ExitcodeT f) Source # 

Methods

liftEq :: (a -> b -> Bool) -> ExitcodeT f a -> ExitcodeT f b -> Bool #

Ord1 f => Ord1 (ExitcodeT f) Source # 

Methods

liftCompare :: (a -> b -> Ordering) -> ExitcodeT f a -> ExitcodeT f b -> Ordering #

Show1 f => Show1 (ExitcodeT f) Source # 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ExitcodeT f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ExitcodeT f a] -> ShowS #

MonadIO f => MonadIO (ExitcodeT f) Source # 

Methods

liftIO :: IO a -> ExitcodeT f a #

Apply f => Apply (ExitcodeT f) Source # 

Methods

(<.>) :: ExitcodeT f (a -> b) -> ExitcodeT f a -> ExitcodeT f b #

(.>) :: ExitcodeT f a -> ExitcodeT f b -> ExitcodeT f b #

(<.) :: ExitcodeT f a -> ExitcodeT f b -> ExitcodeT f a #

liftF2 :: (a -> b -> c) -> ExitcodeT f a -> ExitcodeT f b -> ExitcodeT f c #

MonadCont f => MonadCont (ExitcodeT f) Source # 

Methods

callCC :: ((a -> ExitcodeT f b) -> ExitcodeT f a) -> ExitcodeT f a #

Foldable1 f => Foldable1 (ExitcodeT f) Source # 

Methods

fold1 :: Semigroup m => ExitcodeT f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> ExitcodeT f a -> m #

toNonEmpty :: ExitcodeT f a -> NonEmpty a #

Monad f => Alt (ExitcodeT f) Source # 

Methods

(<!>) :: ExitcodeT f a -> ExitcodeT f a -> ExitcodeT f a #

some :: Applicative (ExitcodeT f) => ExitcodeT f a -> ExitcodeT f [a] #

many :: Applicative (ExitcodeT f) => ExitcodeT f a -> ExitcodeT f [a] #

(Bind f, Monad f) => Bind (ExitcodeT f) Source # 

Methods

(>>-) :: ExitcodeT f a -> (a -> ExitcodeT f b) -> ExitcodeT f b #

join :: ExitcodeT f (ExitcodeT f a) -> ExitcodeT f a #

Applicative f => Extend (ExitcodeT f) Source # 

Methods

duplicated :: ExitcodeT f a -> ExitcodeT f (ExitcodeT f a) #

extended :: (ExitcodeT f a -> b) -> ExitcodeT f a -> ExitcodeT f b #

MFunctor * ExitcodeT Source # 

Methods

hoist :: Monad m => (forall a. m a -> n a) -> t m b -> t n b #

(Eq1 f, Eq a) => Eq (ExitcodeT f a) Source # 

Methods

(==) :: ExitcodeT f a -> ExitcodeT f a -> Bool #

(/=) :: ExitcodeT f a -> ExitcodeT f a -> Bool #

(Ord1 f, Ord a) => Ord (ExitcodeT f a) Source # 

Methods

compare :: ExitcodeT f a -> ExitcodeT f a -> Ordering #

(<) :: ExitcodeT f a -> ExitcodeT f a -> Bool #

(<=) :: ExitcodeT f a -> ExitcodeT f a -> Bool #

(>) :: ExitcodeT f a -> ExitcodeT f a -> Bool #

(>=) :: ExitcodeT f a -> ExitcodeT f a -> Bool #

max :: ExitcodeT f a -> ExitcodeT f a -> ExitcodeT f a #

min :: ExitcodeT f a -> ExitcodeT f a -> ExitcodeT f a #

(Show1 f, Show a) => Show (ExitcodeT f a) Source # 

Methods

showsPrec :: Int -> ExitcodeT f a -> ShowS #

show :: ExitcodeT f a -> String #

showList :: [ExitcodeT f a] -> ShowS #

Monad f => Semigroup (ExitcodeT f a) Source # 

Methods

(<>) :: ExitcodeT f a -> ExitcodeT f a -> ExitcodeT f a #

sconcat :: NonEmpty (ExitcodeT f a) -> ExitcodeT f a #

stimes :: Integral b => b -> ExitcodeT f a -> ExitcodeT f a #

Construction

exitsuccess :: Applicative f => a -> ExitcodeT f a Source #

Construct a succeeding exit code with the given value.

exitsuccess0 :: Applicative f => ExitcodeT0 f Source #

Construct a succeeding exit code with unit.

exitfailure0 :: Applicative f => Int -> ExitcodeT0 f Source #

Construct a failing exit code with the given status.

If the given status is `0` then the exit code will succeed with unit.

Extraction

Optics