prelate-0.8.0.0: A Prelude
Safe HaskellNone
LanguageGHC2021

Prelate.App

Synopsis

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.

runAppLevelE :: Severity -> Sem AppStack a -> IO (Either Text a) Source #

Run the default AppStack with the specified log level and return a potential error as Left.

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.

Methods

exitErrorMessage :: forall (r :: EffectRow). err -> Sem r Text Source #

Instances

Instances details
Show err => ExitErrorMessage err Source # 
Instance details

Defined in Prelate.App

Methods

exitErrorMessage :: forall (r :: EffectRow). err -> Sem r Text Source #