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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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

Versions 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.5
Change log None available
Dependencies base (>=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]
License MIT
Author Johannes Gerer
Maintainer Johannes Gerer <oss@johannesgerer.com>
Category Text, Data, Web
Home page http://johannesgerer.com/blazeT
Bug tracker http://github.com/johannesgerer/blazeT/issues
Source repo head: git clone http://github.com/johannesgerer/blazeT
Uploaded by johannesgerer at 2016-10-26T00:06:00Z

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for blazeT-0.0.5

[back to package description]

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