niagra-0.2.0: CSS EDSL for Haskell

Copyright(c) Nathaniel Symer, 2015
LicenseMIT
Maintainernate@symer.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Data.Niagra.Monad

Description

NiagraT is a monad transformer based on RWST. It stores a combination of total CSS rendering state (blocks) in the writer state & a state of the currently rendering block in the readwrite state.

Synopsis

Documentation

newtype NiagraT m a Source

NiagraT monad transformer.

Constructors

NiagraT (RWST () (Seq Block) (Seq (Selector, Seq Declaration)) m a) 

execNiagraT :: Monad m => Selector -> NiagraT m () -> m (Seq Block) Source

Evaluate a NiagraT monadic action.

withNewScope :: Monad m => Selector -> NiagraT m () -> NiagraT m () Source

Run an act in a fresh NiagraT state.

getCurrentBlock :: Monad m => NiagraT m Block Source

Get a Block from the current NiagraT state.

addBlock :: Monad m => Block -> NiagraT m () Source

Add a Block to the NiagraT writer state.

addDeclaration :: Monad m => Declaration -> NiagraT m () Source

Add a declaration to the NiagraT state.