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

Yesod.Trans.Class

Synopsis

Documentation

class SiteTrans (t :: * -> *) where Source #

The class of site transformations

A site transformation is a wrapper around a Yesod foundation site which augments it with additional functionality.

Methods

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

Lift a Yesod computation to a transformed computation, typically by wrapping the foundation site directly

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

Transform the Yesod computation under a site transformation

Unlike transformers and mtl, ytl does not allow transformers which are not functors in the category of (Yesod) monads. This is because all such transformed monads must still be isomorphic to ReaderT (since that is their underlying representation in Yesod).

Instances

Instances details
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 #

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 #