Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data ExitcodeT f a
- type Exitcode a = ExitcodeT Identity a
- type ExitcodeT0 f = ExitcodeT f ()
- type Exitcode0 = Exitcode ()
- exitsuccess :: Applicative f => a -> ExitcodeT f a
- exitsuccess0 :: Applicative f => ExitcodeT0 f
- exitfailure0 :: Applicative f => Int -> ExitcodeT0 f
- fromExitCode :: Functor f => f ExitCode -> ExitcodeT0 f
- runExitcode :: ExitcodeT f a -> f (Either Int a)
- exitCode :: (Functor f, Functor g) => Iso (f ExitCode) (g ExitCode) (ExitcodeT0 (MaybeT f)) (ExitcodeT0 (MaybeT g))
- _ExitFailure :: Prism' Exitcode0 Int
- _ExitSuccess :: Prism' (Exitcode a) a
Types
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
.
type ExitcodeT0 f = ExitcodeT f () Source #
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.
fromExitCode :: Functor f => f ExitCode -> ExitcodeT0 f Source #
Extraction
Optics
exitCode :: (Functor f, Functor g) => Iso (f ExitCode) (g ExitCode) (ExitcodeT0 (MaybeT f)) (ExitcodeT0 (MaybeT g)) Source #
_ExitSuccess :: Prism' (Exitcode a) a Source #