Safe Haskell | None |
---|---|
Language | Haskell2010 |
Application configuration and top-level RIO
helpers
Synopsis
- get :: (MonadReader cfg m, Has a cfg) => m a
Documentation
get :: (MonadReader cfg m, Has a cfg) => m a Source #
Get a value from the reader config
>>>
data Field = Field Text
>>>
data Cfg = Cfg Field
>>>
>>>
instance Has Field Cfg where hasLens = \f (Cfg field) -> Cfg <$> f field
>>>
>>>
:{
>>>
runRIO (Cfg $ Field "hello world") do
>>>
Field txt <- get
>>>
return txt
>>>
:}
"hello world"