The blazeT package

[maintain]

A true monad (transformer) version of the blaze-markup and blaze-html libraries, implemented as as a very thin wrapper around and strict superset of these libraries.

See Readme on Github.


[Skip to ReadMe]

Properties

Versions0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.5
Dependenciesbase (>=4.0.0.0 && <5), blaze-builder (>=0.2), blaze-html (>=0.6.0.0), blaze-markup (>=0.6.0.0), bytestring, mtl, text, transformers [details]
LicenseMIT
AuthorJohannes Gerer
MaintainerJohannes Gerer <oss@johannesgerer.com>
StabilityExperimental
CategoryText, Data, Web
Home pagehttp://johannesgerer.com/blazeT
Bug trackerhttp://github.com/johannesgerer/blazeT/issues
Source repositoryhead: git clone http://github.com/johannesgerer/blazeT
UploadedWed Oct 26 00:06:00 UTC 2016 by johannesgerer

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for blazeT-0.0.5

blazeT Build Status

A true monad (transformer) version of the blaze-markup and blaze-html libraries.

Why?

While blaze's Markup and Html types have Monad instances and are able to use the concise do notation.

How?

Backwards compatible

The library is intended to serve as a drop-in replacement for the blaze-markup and blaze-html libraries and should be backwards compatible:

Simply replace your module Text.Blaze.* imports with module Text.BlazeT.* and it should give the same results.

For usage of blaze check out their documentation.

Unleash the monads

Implementation Details (from Text.BlazeT.Internals)

Everything build around the simple newtype definition of the MarkupT transformer, which is basically a WriterT transformer writing Blaze.Markup:

newtype MarkupT m a= MarkupT { fromMarkupT :: WriterT B.Markup m a }

Wrappers used to lift all Blaze entities into BlazeT are trivially expressible using basic WriterT class methods:

-- | Wrapping `Blaze.Markup` is simply `WriterT.tell`
wrapMarkupT :: Monad m => B.Markup -> MarkupT m ()
wrapMarkupT = tell

-- | Wrapping functions that modify `Blaze.Markup` is simply  `WriterT.censor`
wrapMarkupT2 ::  Monad m => (B.Markup -> B.Markup)
                 -> MarkupT m a -> MarkupT m a
wrapMarkupT2 = censor