| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Prelate.App
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 :: (Type -> Type) -> Type -> Type] ++ ConcStack
- resumeExit :: forall err (eff :: (Type -> Type) -> Type -> Type) (r :: EffectRow). (ExitErrorMessage err, Members '[eff !! err, Error Text :: (Type -> Type) -> Type -> Type] r) => InterpreterFor eff r
- class ExitErrorMessage err where
- exitErrorMessage :: forall (r :: EffectRow). 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 :: (Type -> Type) -> Type -> Type] ++ ConcStack Source #
The default stack for a Prelate app.
resumeExit :: forall err (eff :: (Type -> Type) -> Type -> Type) (r :: EffectRow). (ExitErrorMessage err, Members '[eff !! err, Error Text :: (Type -> Type) -> Type -> Type] 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.
Instances
| Show err => ExitErrorMessage err Source # | |
Defined in Prelate.App | |