From 6b43720bb655cfade810b67fde62845776ce1ef2 Mon Sep 17 00:00:00 2001 From: Johannes Gerer Date: Thu, 27 Oct 2016 02:13:47 +0200 Subject: a --- README.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 853f1e2..37e4be5 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,13 @@ their [documentation](https://jaspervdj.be/blaze/). ## Unleash the monads -[Text.BlazeT](https://hackage.haskell.org/package/blazeT/docs/Text-BlazeT.html) exports -`runWith` and `execWith`, which work on any -`Text.Blaze.Renderer.*`. The rendered markup will be returned within -the base monad, whose actions can -be -[`lift`ed](https://hackage.haskell.org/package/transformers-0.5.2.0/docs/Control-Monad-Trans-Class.html) into -the Markup, as shown in the following example -(from [here](src/Readme.hs)): +[Text.BlazeT](https://hackage.haskell.org/package/blazeT/docs/Text-BlazeT.html) +exports `runWith` and `execWith`, which work on any +`Text.BlazeT.Renderer.*`. The rendered markup will be returned within +the base monad, whose actions can be +[`lift`ed](https://hackage.haskell.org/package/transformers-0.5.2.0/docs/Control-Monad-Trans-Class.html) +into the Markup, as shown in the following example (from +[here](src/Readme.hs)): ```Haskell {-# LANGUAGE OverloadedStrings #-} @@ -123,8 +122,16 @@ of `Blaze.Markup` and is basically a `WriterT` writing `Blaze.Markup`: newtype MarkupT m a = MarkupT { fromMarkupT :: WriterT B.Markup m a } ``` +The old `Text.Blaze.Markup` type is replaced by a rank-2 version of +the transformer: + +```Haskell +type Markup = forall m . Monad m => MarkupT m () +``` + Wrappers used to lift all `Blaze` entities into `BlazeT` are trivially -expressible using basic `WriterT` class methods. Wrapping `Blaze.Markup` is simply `WriterT.tell`: +expressible using basic `WriterT` class methods. Wrapping +`Blaze.Markup` is simply `WriterT.tell`: ```Haskell wrapMarkupT :: Monad m => B.Markup -> MarkupT m () @@ -137,4 +144,3 @@ wrapMarkupT2 :: Monad m => (B.Markup -> B.Markup) -> MarkupT m a -> MarkupT m a wrapMarkupT2 = censor ``` - -- cgit v1.2.3