ytl-0.1.0.0: mtl-style transformations for Yesod sites
Safe HaskellNone
LanguageHaskell2010

Yesod.Trans.Class.Reader

Synopsis

Documentation

data ReaderSite r site Source #

A site transformation which extends a site with some additional data which can be read

Constructors

ReaderSite 

Fields

Instances

Instances details
SiteReader r (ReaderSite r site) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

Methods

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 #

Eq (Route site) => Eq (Route (ReaderSite r site)) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

Methods

(==) :: Route (ReaderSite r site) -> Route (ReaderSite r site) -> Bool #

(/=) :: Route (ReaderSite r site) -> Route (ReaderSite r site) -> Bool #

Copointed (ReaderSite r) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

Methods

copoint :: ReaderSite r a -> a #

SiteTrans (ReaderSite r) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

Methods

lift :: MonadSite m => m site a -> m (ReaderSite r site) a Source #

mapSiteT :: (MonadSite m, MonadSite n, SiteCompatible site site') => (m site a -> n site' b) -> m (ReaderSite r site) a -> n (ReaderSite r site') b Source #

RenderRoute site => RenderRoute (ReaderSite r site) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

Associated Types

data Route (ReaderSite r site) #

Methods

renderRoute :: Route (ReaderSite r site) -> ([Text], [(Text, Text)]) #

newtype Route (ReaderSite r site) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

newtype Route (ReaderSite r site) = ReaderRoute (Route site)

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

Minimal complete definition

(ask | reader), local

Methods

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

Instances details
(SiteTrans t, SiteReader r site) => SiteReader r (t site) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

Methods

ask :: MonadSite m => m (t site) r Source #

reader :: MonadSite m => (r -> a) -> m (t site) a Source #

local :: MonadSite m => (r -> r) -> m (t site) a -> m (t site) a Source #

SiteReader r (ReaderSite r site) Source # 
Instance details

Defined in Yesod.Trans.Class.Reader

Methods

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 #