aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authorJohannes Gerer <oss@johannesgerer.com>2016-10-27 02:13:47 +0200
committerJohannes Gerer <oss@johannesgerer.com>2016-10-27 02:13:47 +0200
commit6b43720bb655cfade810b67fde62845776ce1ef2 (patch)
tree3433db574dc8d074354ae70232d29a9cb81ba136 /README.md
parent86d89e47d648770ae36dba01f7ae09d34f2ee171 (diff)
downloadblazeT-6b43720bb655cfade810b67fde62845776ce1ef2.tar.gz
blazeT-6b43720bb655cfade810b67fde62845776ce1ef2.tar.zst
blazeT-6b43720bb655cfade810b67fde62845776ce1ef2.zip
a
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 16 insertions, 10 deletions
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/).
51 51
52## Unleash the monads 52## Unleash the monads
53 53
54[Text.BlazeT](https://hackage.haskell.org/package/blazeT/docs/Text-BlazeT.html) exports 54[Text.BlazeT](https://hackage.haskell.org/package/blazeT/docs/Text-BlazeT.html)
55`runWith` and `execWith`, which work on any 55exports `runWith` and `execWith`, which work on any
56`Text.Blaze.Renderer.*`. The rendered markup will be returned within 56`Text.BlazeT.Renderer.*`. The rendered markup will be returned within
57the base monad, whose actions can 57the base monad, whose actions can be
58be 58[`lift`ed](https://hackage.haskell.org/package/transformers-0.5.2.0/docs/Control-Monad-Trans-Class.html)
59[`lift`ed](https://hackage.haskell.org/package/transformers-0.5.2.0/docs/Control-Monad-Trans-Class.html) into 59into the Markup, as shown in the following example (from
60the Markup, as shown in the following example 60[here](src/Readme.hs)):
61(from [here](src/Readme.hs)):
62 61
63```Haskell 62```Haskell
64{-# LANGUAGE OverloadedStrings #-} 63{-# LANGUAGE OverloadedStrings #-}
@@ -123,8 +122,16 @@ of `Blaze.Markup` and is basically a `WriterT` writing `Blaze.Markup`:
123newtype MarkupT m a = MarkupT { fromMarkupT :: WriterT B.Markup m a } 122newtype MarkupT m a = MarkupT { fromMarkupT :: WriterT B.Markup m a }
124``` 123```
125 124
125The old `Text.Blaze.Markup` type is replaced by a rank-2 version of
126the transformer:
127
128```Haskell
129type Markup = forall m . Monad m => MarkupT m ()
130```
131
126Wrappers used to lift all `Blaze` entities into `BlazeT` are trivially 132Wrappers used to lift all `Blaze` entities into `BlazeT` are trivially
127expressible using basic `WriterT` class methods. Wrapping `Blaze.Markup` is simply `WriterT.tell`: 133expressible using basic `WriterT` class methods. Wrapping
134`Blaze.Markup` is simply `WriterT.tell`:
128 135
129```Haskell 136```Haskell
130wrapMarkupT :: Monad m => B.Markup -> MarkupT m () 137wrapMarkupT :: Monad m => B.Markup -> MarkupT m ()
@@ -137,4 +144,3 @@ wrapMarkupT2 :: Monad m => (B.Markup -> B.Markup) -> MarkupT m a -> MarkupT m a
137wrapMarkupT2 = censor 144wrapMarkupT2 = censor
138``` 145```
139 146
140