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

Yesod.Trans.Class.Writer

Synopsis

Documentation

data WriterSite w site Source #

A site transformation which extends a site with some writing output

Instances

Instances details
Monoid w => SiteWriter w (WriterSite w site) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

Methods

writer :: MonadSite m => (a, w) -> m (WriterSite w site) a Source #

tell :: MonadSite m => w -> m (WriterSite w site) () Source #

listen :: MonadSite m => m (WriterSite w site) a -> m (WriterSite w site) (a, w) Source #

pass :: MonadSite m => m (WriterSite w site) (a, w -> w) -> m (WriterSite w site) a Source #

Eq (Route site) => Eq (Route (WriterSite w site)) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

Methods

(==) :: Route (WriterSite w site) -> Route (WriterSite w site) -> Bool #

(/=) :: Route (WriterSite w site) -> Route (WriterSite w site) -> Bool #

Copointed (WriterSite w) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

Methods

copoint :: WriterSite w a -> a #

SiteTrans (WriterSite w) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

Methods

lift :: MonadSite m => m site a -> m (WriterSite w site) a Source #

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

RenderRoute site => RenderRoute (WriterSite w site) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

Associated Types

data Route (WriterSite w site) #

Methods

renderRoute :: Route (WriterSite w site) -> ([Text], [(Text, Text)]) #

newtype Route (WriterSite w site) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

newtype Route (WriterSite w site) = WriterRoute (Route (ReaderSite (IORef w) site))

class Monoid w => SiteWriter w site where Source #

The class of sites which have some writing output

Minimal complete definition

(writer | tell), listen, pass

Methods

writer :: MonadSite m => (a, w) -> m site a Source #

Write something to the output, returning a wrapped value

tell :: MonadSite m => w -> m site () Source #

Write something to the output

listen :: MonadSite m => m site a -> m site (a, w) Source #

Run a computation, returning the resulting contents of the output

pass :: MonadSite m => m site (a, w -> w) -> m site a Source #

Run a computation which modifies the output

Instances

Instances details
(SiteTrans t, SiteWriter w site) => SiteWriter w (t site) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

Methods

writer :: MonadSite m => (a, w) -> m (t site) a Source #

tell :: MonadSite m => w -> m (t site) () Source #

listen :: MonadSite m => m (t site) a -> m (t site) (a, w) Source #

pass :: MonadSite m => m (t site) (a, w -> w) -> m (t site) a Source #

Monoid w => SiteWriter w (WriterSite w site) Source # 
Instance details

Defined in Yesod.Trans.Class.Writer

Methods

writer :: MonadSite m => (a, w) -> m (WriterSite w site) a Source #

tell :: MonadSite m => w -> m (WriterSite w site) () Source #

listen :: MonadSite m => m (WriterSite w site) a -> m (WriterSite w site) (a, w) Source #

pass :: MonadSite m => m (WriterSite w site) (a, w -> w) -> m (WriterSite w site) a Source #