Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype WriterSite w site = WriterSite {
- unWriterSite :: ReaderSite (IORef w) site
- runWriterSite :: (MonadSite m, Monoid w) => m (WriterSite w site) a -> m site (a, w)
- class Monoid w => SiteWriter w site | site -> w where
Documentation
newtype WriterSite w site Source #
A site transformation which extends a site with some writing output
WriterSite | |
|
Instances
runWriterSite :: (MonadSite m, Monoid w) => m (WriterSite w site) a -> m site (a, w) Source #
Compute the effect of a WriterSite
, getting back the output after having
run the computation
class Monoid w => SiteWriter w site | site -> w where Source #
The class of sites which have some writing output
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
(SiteTrans t, SiteWriter w site) => SiteWriter w (t site) Source # | |
Monoid w => SiteWriter w (WriterSite w site) Source # | |
Defined in Yesod.Trans.Class.Writer 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 # |