rio-app-0.1.0.0: Generic App type for rio.
Safe HaskellNone
LanguageHaskell2010

RIO.App

Synopsis

Documentation

data App env st Source #

Instances

Instances details
HasStateRef st (App env st) Source # 
Instance details

Defined in RIO.App

Methods

stateRefL :: Lens' (App env st) (SomeRef st) #

MonadResource (RIO (App env st)) Source # 
Instance details

Defined in RIO.App

Methods

liftResourceT :: ResourceT IO a -> RIO (App env st) a #

HasProcessContext (App env st) Source # 
Instance details

Defined in RIO.App

HasLogFunc (App env st) Source # 
Instance details

Defined in RIO.App

Methods

logFuncL :: Lens' (App env st) LogFunc #

type SetupApp = App () () Source #

Bootstrap environment.

Has logging and hold permanent resources, but no env and state of its own. Used to setup initial environment and state, that can be derived from allocated resources.

appMain :: IO options -> (options -> Bool) -> (options -> RIO SetupApp (env, st)) -> RIO (App env st) () -> IO () Source #

nestApp :: (MonadUnliftIO m, MonadReader (App env st) m) => RIO (App env st) (innerEnv, innerSt) -> RIO (App innerEnv innerSt) a -> m a Source #