Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- runApp :: Sem AppStack a -> IO a
- runAppLevel :: Severity -> Sem AppStack a -> IO a
- runAppLevelE :: Severity -> Sem AppStack a -> IO (Either Text a)
- type AppStack = [ChronosTime, Log, Interrupt, Critical, Error Text] ++ ConcStack
- resumeExit :: forall err eff r. ExitErrorMessage err => Members [eff !! err, Error Text] r => InterpreterFor eff r
- class ExitErrorMessage err where
- exitErrorMessage :: err -> Sem r Text
Documentation
runApp :: Sem AppStack a -> IO a Source #
Run the default AppStack
and print an potential error to stderr, exiting with failure code.
runAppLevel :: Severity -> Sem AppStack a -> IO a Source #
Run the default AppStack
with the specified log level and print a potential error to stderr, exiting with failure
code.
type AppStack = [ChronosTime, Log, Interrupt, Critical, Error Text] ++ ConcStack Source #
The default stack for a Prelate app.
resumeExit :: forall err eff r. ExitErrorMessage err => Members [eff !! err, Error Text] r => InterpreterFor eff r Source #
Convert an effect to Resumable
and throw a potential error as Text
, exiting the program if used with runApp
.
Uses ExitErrorMessage
to render the error.
class ExitErrorMessage err where Source #
Render an error for printing it as an exit message.
exitErrorMessage :: err -> Sem r Text Source #
Instances
Show err => ExitErrorMessage err Source # | |
Defined in Prelate.App |