Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ReaderSite r site = ReaderSite {
- readVal :: r
- unReaderSite :: site
- runReaderSite :: MonadSite m => r -> m (ReaderSite r site) a -> m site a
- class SiteReader r site | site -> r where
Documentation
data ReaderSite r site Source #
A site transformation which extends a site with some additional data which can be read
ReaderSite | |
|
Instances
runReaderSite :: MonadSite m => r -> m (ReaderSite r site) a -> m site a Source #
Compute the effect of ReaderSite
by passing in the data value to be
used when reading
class SiteReader r site | site -> r where Source #
The class of sites which can read some data
ask :: MonadSite m => m site r Source #
Get the data value
reader :: MonadSite m => (r -> a) -> m site a Source #
Extract a value from the data
local :: MonadSite m => (r -> r) -> m site a -> m site a Source #
Run a computation with a transformed version of the current data value
Instances
(SiteTrans t, SiteReader r site) => SiteReader r (t site) Source # | |
SiteReader r (ReaderSite r site) Source # | |
Defined in Yesod.Trans.Class.Reader ask :: MonadSite m => m (ReaderSite r site) r Source # reader :: MonadSite m => (r -> a) -> m (ReaderSite r site) a Source # local :: MonadSite m => (r -> r) -> m (ReaderSite r site) a -> m (ReaderSite r site) a Source # |