keter-2.1.2: Web application deployment manager, focusing on Haskell web frameworks
Safe HaskellSafe-Inferred
LanguageHaskell98

Keter.Context

Synopsis

Documentation

newtype KeterM cfg a Source #

The top-level keter context monad, carrying around the main logger and some locally relevant configuration structure.

See this blog post for an explanation of the design philosophy: https://www.fpcomplete.com/blog/2017/06/readert-design-pattern/

TODO: generalize as contexts instead of configs? Since not every state being passed around can be intuitively thought of as a config per se. Ex. AppManager

Constructors

KeterM 

Fields

Instances

Instances details
MonadReader cfg (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

ask :: KeterM cfg cfg #

local :: (cfg -> cfg) -> KeterM cfg a -> KeterM cfg a #

reader :: (cfg -> a) -> KeterM cfg a #

MonadIO (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

liftIO :: IO a -> KeterM cfg a #

Applicative (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

pure :: a -> KeterM cfg a #

(<*>) :: KeterM cfg (a -> b) -> KeterM cfg a -> KeterM cfg b #

liftA2 :: (a -> b -> c) -> KeterM cfg a -> KeterM cfg b -> KeterM cfg c #

(*>) :: KeterM cfg a -> KeterM cfg b -> KeterM cfg b #

(<*) :: KeterM cfg a -> KeterM cfg b -> KeterM cfg a #

Functor (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

fmap :: (a -> b) -> KeterM cfg a -> KeterM cfg b #

(<$) :: a -> KeterM cfg b -> KeterM cfg a #

Monad (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

(>>=) :: KeterM cfg a -> (a -> KeterM cfg b) -> KeterM cfg b #

(>>) :: KeterM cfg a -> KeterM cfg b -> KeterM cfg b #

return :: a -> KeterM cfg a #

MonadLogger (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> KeterM cfg () #

MonadLoggerIO (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

askLoggerIO :: KeterM cfg (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) #

MonadUnliftIO (KeterM cfg) Source # 
Instance details

Defined in Keter.Context

Methods

withRunInIO :: ((forall a. KeterM cfg a -> IO a) -> IO b) -> KeterM cfg b #

withMappedConfig :: (cfg -> cfg') -> KeterM cfg' a -> KeterM cfg a Source #