aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Text/BlazeT/Renderer
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/BlazeT/Renderer')
-rw-r--r--src/Text/BlazeT/Renderer/Pretty.hs10
-rw-r--r--src/Text/BlazeT/Renderer/String.hs8
-rw-r--r--src/Text/BlazeT/Renderer/Text.hs50
-rw-r--r--src/Text/BlazeT/Renderer/Utf8.hs34
4 files changed, 15 insertions, 87 deletions
diff --git a/src/Text/BlazeT/Renderer/Pretty.hs b/src/Text/BlazeT/Renderer/Pretty.hs
index 8977c94..fa8cdad 100644
--- a/src/Text/BlazeT/Renderer/Pretty.hs
+++ b/src/Text/BlazeT/Renderer/Pretty.hs
@@ -1,22 +1,14 @@
1module Text.BlazeT.Renderer.Pretty 1module Text.BlazeT.Renderer.Pretty
2 ( renderMarkup 2 ( renderMarkup
3 , renderHtml 3 , renderHtml
4 , renderMarkupT
5 , renderHtmlT
6 ) where 4 ) where
7 5
8import Control.Monad
9import Control.Monad.Identity
10import qualified Text.Blaze.Renderer.Pretty as BU 6import qualified Text.Blaze.Renderer.Pretty as BU
11import Text.BlazeT 7import Text.BlazeT
12 8
13renderMarkup :: MarkupM a -> String 9renderMarkup :: MarkupM a -> String
14renderMarkup = runIdentity . renderMarkupT 10renderMarkup = BU.renderMarkup . execMarkup
15renderMarkupT :: Monad m => MarkupT m a -> m String
16renderMarkupT = liftM BU.renderMarkup . execMarkupT
17 11
18renderHtml :: MarkupM a -> String 12renderHtml :: MarkupM a -> String
19renderHtml = renderMarkup 13renderHtml = renderMarkup
20renderHtmlT :: Monad m => MarkupT m a -> m String
21renderHtmlT = renderMarkupT
22 14
diff --git a/src/Text/BlazeT/Renderer/String.hs b/src/Text/BlazeT/Renderer/String.hs
index 0a2de8a..9f0e0a0 100644
--- a/src/Text/BlazeT/Renderer/String.hs
+++ b/src/Text/BlazeT/Renderer/String.hs
@@ -2,8 +2,6 @@ module Text.BlazeT.Renderer.String
2 ( fromChoiceString 2 ( fromChoiceString
3 , renderMarkup 3 , renderMarkup
4 , renderHtml 4 , renderHtml
5 , renderMarkupT
6 , renderHtmlT
7 ) where 5 ) where
8 6
9import Control.Monad 7import Control.Monad
@@ -16,12 +14,8 @@ fromChoiceString :: ChoiceString -> String -> String
16fromChoiceString = BU.fromChoiceString 14fromChoiceString = BU.fromChoiceString
17 15
18renderMarkup :: MarkupM a -> String 16renderMarkup :: MarkupM a -> String
19renderMarkup = runIdentity . renderMarkupT 17renderMarkup = BU.renderMarkup . execMarkup
20renderMarkupT :: Monad m => MarkupT m a -> m String
21renderMarkupT = liftM BU.renderMarkup . execMarkupT
22 18
23renderHtml :: MarkupM a -> String 19renderHtml :: MarkupM a -> String
24renderHtml = renderMarkup 20renderHtml = renderMarkup
25renderHtmlT :: Monad m => MarkupT m a -> m String
26renderHtmlT = renderMarkupT
27 21
diff --git a/src/Text/BlazeT/Renderer/Text.hs b/src/Text/BlazeT/Renderer/Text.hs
index 31181eb..991c81c 100644
--- a/src/Text/BlazeT/Renderer/Text.hs
+++ b/src/Text/BlazeT/Renderer/Text.hs
@@ -1,13 +1,5 @@
1module Text.BlazeT.Renderer.Text 1module Text.BlazeT.Renderer.Text
2 ( renderMarkupBuilderT 2 ( renderMarkupBuilder
3 , renderMarkupBuilder
4 , renderMarkupBuilderWithT
5 , renderMarkupT
6 , renderMarkupWithT
7 , renderHtmlBuilderT
8 , renderHtmlBuilderWithT
9 , renderHtmlT
10 , renderHtmlWithT
11 , renderMarkupBuilderWith 3 , renderMarkupBuilderWith
12 , renderMarkup 4 , renderMarkup
13 , renderMarkupWith 5 , renderMarkupWith
@@ -17,9 +9,7 @@ module Text.BlazeT.Renderer.Text
17 , renderHtmlWith 9 , renderHtmlWith
18 ) where 10 ) where
19 11
20import Control.Monad
21import Data.ByteString (ByteString) 12import Data.ByteString (ByteString)
22import Control.Monad.Identity
23import Data.Text (Text) 13import Data.Text (Text)
24import qualified Data.Text.Lazy as L 14import qualified Data.Text.Lazy as L
25import qualified Data.Text.Lazy.Builder as B 15import qualified Data.Text.Lazy.Builder as B
@@ -28,48 +18,26 @@ import qualified Text.Blaze.Renderer.Text as BU
28import Text.BlazeT 18import Text.BlazeT
29 19
30renderMarkupBuilder :: MarkupM a -> B.Builder 20renderMarkupBuilder :: MarkupM a -> B.Builder
31renderMarkupBuilder = runIdentity . renderMarkupBuilderT 21renderMarkupBuilder = BU.renderMarkupBuilder . execMarkup
32
33renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder
34renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT
35 22
36renderHtmlBuilder :: MarkupM a -> B.Builder 23renderHtmlBuilder :: MarkupM a -> B.Builder
37renderHtmlBuilder = renderMarkupBuilder 24renderHtmlBuilder = renderMarkupBuilder
38 25
39renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder
40renderHtmlBuilderT = renderMarkupBuilderT
41
42renderMarkup :: MarkupM a -> L.Text 26renderMarkup :: MarkupM a -> L.Text
43renderMarkup = runIdentity . renderMarkupT 27renderMarkup = BU.renderMarkup . execMarkup
44renderMarkupT :: Monad m => MarkupT m a -> m L.Text
45renderMarkupT = liftM BU.renderMarkup . execMarkupT
46 28
47renderHtml :: MarkupM a -> L.Text 29renderHtml :: MarkupM a -> L.Text
48renderHtml = renderMarkup 30renderHtml = renderMarkup
49renderHtmlT :: Monad m => MarkupT m a -> m L.Text
50renderHtmlT = renderMarkupT
51
52renderMarkupWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text
53renderMarkupWithT g = liftM (BU.renderMarkupWith g) . execMarkupT
54 31
55renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text 32renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text
56renderMarkupWith g = runIdentity . renderMarkupWithT g 33renderMarkupWith g = (BH.renderHtmlWith g) . execMarkup
57
58renderHtmlWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text
59renderHtmlWithT g = liftM (BH.renderHtmlWith g) . execMarkupT
60 34
61renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text 35renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text
62renderHtmlWith g = runIdentity . renderHtmlWithT g 36renderHtmlWith = renderMarkupWith
63
64renderHtmlBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder
65renderHtmlBuilderWithT g = liftM (BH.renderHtmlBuilderWith g) . execMarkupT
66
67renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
68renderHtmlBuilderWith g = runIdentity . renderHtmlBuilderWithT g
69 37
38renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
39renderMarkupBuilderWith g = (BU.renderMarkupBuilderWith g) . execMarkup
70 40
71renderMarkupBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder 41renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
72renderMarkupBuilderWithT g = liftM (BU.renderMarkupBuilderWith g) . execMarkupT 42renderHtmlBuilderWith = renderHtmlBuilderWith
73 43
74renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
75renderMarkupBuilderWith g = runIdentity . renderMarkupBuilderWithT g
diff --git a/src/Text/BlazeT/Renderer/Utf8.hs b/src/Text/BlazeT/Renderer/Utf8.hs
index 292f81f..b5fd656 100644
--- a/src/Text/BlazeT/Renderer/Utf8.hs
+++ b/src/Text/BlazeT/Renderer/Utf8.hs
@@ -13,54 +13,28 @@ module Text.BlazeT.Renderer.Utf8
13 , renderHtmlBuilder 13 , renderHtmlBuilder
14 , renderHtml 14 , renderHtml
15 , renderHtmlToByteStringIO 15 , renderHtmlToByteStringIO
16
17 -- * new BlazeT stuff
18 , renderMarkupBuilderT
19 , renderMarkupT
20 , renderMarkupToByteStringIOT
21 , renderHtmlToByteStringIOT
22 , renderHtmlBuilderT
23 , renderHtmlT
24 ) where 16 ) where
25 17
26import qualified Blaze.ByteString.Builder as B 18import qualified Blaze.ByteString.Builder as B
27import Control.Monad
28import Control.Monad.Identity
29import qualified Data.ByteString as BS 19import qualified Data.ByteString as BS
30import qualified Data.ByteString.Lazy as BL 20import qualified Data.ByteString.Lazy as BL
31import qualified Text.Blaze.Renderer.Utf8 as BU 21import qualified Text.Blaze.Renderer.Utf8 as BU
32import Text.BlazeT 22import Text.BlazeT
33 23
34renderMarkupBuilder :: MarkupM a -> B.Builder 24renderMarkupBuilder :: MarkupM a -> B.Builder
35renderMarkupBuilder = runIdentity . renderMarkupBuilderT 25renderMarkupBuilder = BU.renderMarkupBuilder . execMarkup
36
37renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder
38renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT
39 26
40renderHtmlBuilder :: MarkupM a -> B.Builder 27renderHtmlBuilder :: MarkupM a -> B.Builder
41renderHtmlBuilder = renderMarkupBuilder 28renderHtmlBuilder = renderMarkupBuilder
42 29
43renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder
44renderHtmlBuilderT = renderMarkupBuilderT
45
46renderMarkup :: MarkupM a -> BL.ByteString 30renderMarkup :: MarkupM a -> BL.ByteString
47renderMarkup = runIdentity . renderMarkupT 31renderMarkup = BU.renderMarkup . execMarkup
48renderMarkupT :: Monad m => MarkupT m a -> m BL.ByteString
49renderMarkupT = liftM BU.renderMarkup . execMarkupT
50 32
51renderHtml :: MarkupM a -> BL.ByteString 33renderHtml :: MarkupM a -> BL.ByteString
52renderHtml = renderMarkup 34renderHtml = renderMarkup
53renderHtmlT :: Monad m => MarkupT m a -> m BL.ByteString
54renderHtmlT = renderMarkupT
55 35
56renderMarkupToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () 36renderMarkupToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO ()
57renderMarkupToByteStringIO g = runIdentity . renderMarkupToByteStringIOT g 37renderMarkupToByteStringIO g = BU.renderMarkupToByteStringIO g . execMarkup
58renderMarkupToByteStringIOT :: Monad m => (BS.ByteString -> IO ()) ->
59 MarkupT m a -> m (IO ())
60renderMarkupToByteStringIOT g = liftM (BU.renderMarkupToByteStringIO g) . execMarkupT
61 38
62renderHtmlToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () 39renderHtmlToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO ()
63renderHtmlToByteStringIO g = runIdentity . renderMarkupToByteStringIOT g 40renderHtmlToByteStringIO = renderMarkupToByteStringIO
64renderHtmlToByteStringIOT :: Monad m => (BS.ByteString -> IO ()) ->
65 MarkupT m a -> m (IO ())
66renderHtmlToByteStringIOT g = liftM (BU.renderMarkupToByteStringIO g) . execMarkupT