aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Text/BlazeT/Renderer/Text.hs
blob: 31181eb062336a1a5702814c5500e8e7a2afa4a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
module Text.BlazeT.Renderer.Text
    ( renderMarkupBuilderT
    , renderMarkupBuilder
    , renderMarkupBuilderWithT
    , renderMarkupT
    , renderMarkupWithT
    , renderHtmlBuilderT
    , renderHtmlBuilderWithT
    , renderHtmlT
    , renderHtmlWithT
    , renderMarkupBuilderWith
    , renderMarkup
    , renderMarkupWith
    , renderHtmlBuilder
    , renderHtmlBuilderWith
    , renderHtml
    , renderHtmlWith
  ) where

import           Control.Monad
import           Data.ByteString (ByteString)
import           Control.Monad.Identity
import           Data.Text (Text)
import qualified Data.Text.Lazy as L
import qualified Data.Text.Lazy.Builder as B
import qualified Text.Blaze.Html.Renderer.Text as BH
import qualified Text.Blaze.Renderer.Text as BU
import           Text.BlazeT

renderMarkupBuilder :: MarkupM a -> B.Builder
renderMarkupBuilder = runIdentity . renderMarkupBuilderT

renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder
renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT

renderHtmlBuilder :: MarkupM a -> B.Builder
renderHtmlBuilder = renderMarkupBuilder

renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder
renderHtmlBuilderT = renderMarkupBuilderT

renderMarkup :: MarkupM a -> L.Text
renderMarkup = runIdentity . renderMarkupT
renderMarkupT :: Monad m => MarkupT m a -> m L.Text
renderMarkupT = liftM BU.renderMarkup . execMarkupT

renderHtml :: MarkupM a -> L.Text
renderHtml = renderMarkup
renderHtmlT :: Monad m => MarkupT m a -> m L.Text
renderHtmlT = renderMarkupT

renderMarkupWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text
renderMarkupWithT g = liftM (BU.renderMarkupWith g) . execMarkupT

renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text
renderMarkupWith g = runIdentity . renderMarkupWithT g

renderHtmlWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text
renderHtmlWithT g = liftM (BH.renderHtmlWith g) . execMarkupT

renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text
renderHtmlWith g = runIdentity . renderHtmlWithT g

renderHtmlBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder       
renderHtmlBuilderWithT g = liftM (BH.renderHtmlBuilderWith g) . execMarkupT

renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder       
renderHtmlBuilderWith g = runIdentity . renderHtmlBuilderWithT g


renderMarkupBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder      
renderMarkupBuilderWithT g = liftM (BU.renderMarkupBuilderWith g) . execMarkupT

renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder       
renderMarkupBuilderWith g = runIdentity . renderMarkupBuilderWithT g