prelate-0.7.0.1: A Prelude
Safe HaskellSafe-Inferred
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] ++ 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.

Methods

exitErrorMessage :: 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 #