diff options
Diffstat (limited to 'src/Text/BlazeT/Renderer/Utf8.hs')
-rw-r--r-- | src/Text/BlazeT/Renderer/Utf8.hs | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/src/Text/BlazeT/Renderer/Utf8.hs b/src/Text/BlazeT/Renderer/Utf8.hs index 292f81f..2874b68 100644 --- a/src/Text/BlazeT/Renderer/Utf8.hs +++ b/src/Text/BlazeT/Renderer/Utf8.hs | |||
@@ -1,3 +1,4 @@ | |||
1 | {-# LANGUAGE RankNTypes #-} | ||
1 | {-# OPTIONS_GHC -fsimpl-tick-factor=230 #-} | 2 | {-# OPTIONS_GHC -fsimpl-tick-factor=230 #-} |
2 | 3 | ||
3 | -- the above option was not needed with | 4 | -- the above option was not needed with |
@@ -13,54 +14,28 @@ module Text.BlazeT.Renderer.Utf8 | |||
13 | , renderHtmlBuilder | 14 | , renderHtmlBuilder |
14 | , renderHtml | 15 | , renderHtml |
15 | , renderHtmlToByteStringIO | 16 | , renderHtmlToByteStringIO |
16 | |||
17 | -- * new BlazeT stuff | ||
18 | , renderMarkupBuilderT | ||
19 | , renderMarkupT | ||
20 | , renderMarkupToByteStringIOT | ||
21 | , renderHtmlToByteStringIOT | ||
22 | , renderHtmlBuilderT | ||
23 | , renderHtmlT | ||
24 | ) where | 17 | ) where |
25 | 18 | ||
26 | import qualified Blaze.ByteString.Builder as B | 19 | import qualified Blaze.ByteString.Builder as B |
27 | import Control.Monad | ||
28 | import Control.Monad.Identity | ||
29 | import qualified Data.ByteString as BS | 20 | import qualified Data.ByteString as BS |
30 | import qualified Data.ByteString.Lazy as BL | 21 | import qualified Data.ByteString.Lazy as BL |
31 | import qualified Text.Blaze.Renderer.Utf8 as BU | 22 | import qualified Text.Blaze.Renderer.Utf8 as BU |
32 | import Text.BlazeT | 23 | import Text.BlazeT |
33 | 24 | ||
34 | renderMarkupBuilder :: MarkupM a -> B.Builder | 25 | renderMarkupBuilder :: MarkupM a -> B.Builder |
35 | renderMarkupBuilder = runIdentity . renderMarkupBuilderT | 26 | renderMarkupBuilder = BU.renderMarkupBuilder . execMarkup |
36 | |||
37 | renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
38 | renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT | ||
39 | 27 | ||
40 | renderHtmlBuilder :: MarkupM a -> B.Builder | 28 | renderHtmlBuilder :: MarkupM a -> B.Builder |
41 | renderHtmlBuilder = renderMarkupBuilder | 29 | renderHtmlBuilder = renderMarkupBuilder |
42 | 30 | ||
43 | renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
44 | renderHtmlBuilderT = renderMarkupBuilderT | ||
45 | |||
46 | renderMarkup :: MarkupM a -> BL.ByteString | 31 | renderMarkup :: MarkupM a -> BL.ByteString |
47 | renderMarkup = runIdentity . renderMarkupT | 32 | renderMarkup = BU.renderMarkup . execMarkup |
48 | renderMarkupT :: Monad m => MarkupT m a -> m BL.ByteString | ||
49 | renderMarkupT = liftM BU.renderMarkup . execMarkupT | ||
50 | 33 | ||
51 | renderHtml :: MarkupM a -> BL.ByteString | 34 | renderHtml :: MarkupM a -> BL.ByteString |
52 | renderHtml = renderMarkup | 35 | renderHtml = renderMarkup |
53 | renderHtmlT :: Monad m => MarkupT m a -> m BL.ByteString | ||
54 | renderHtmlT = renderMarkupT | ||
55 | 36 | ||
56 | renderMarkupToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () | 37 | renderMarkupToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () |
57 | renderMarkupToByteStringIO g = runIdentity . renderMarkupToByteStringIOT g | 38 | renderMarkupToByteStringIO g = BU.renderMarkupToByteStringIO g . execMarkup |
58 | renderMarkupToByteStringIOT :: Monad m => (BS.ByteString -> IO ()) -> | ||
59 | MarkupT m a -> m (IO ()) | ||
60 | renderMarkupToByteStringIOT g = liftM (BU.renderMarkupToByteStringIO g) . execMarkupT | ||
61 | 39 | ||
62 | renderHtmlToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () | 40 | renderHtmlToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () |
63 | renderHtmlToByteStringIO g = runIdentity . renderMarkupToByteStringIOT g | 41 | renderHtmlToByteStringIO = renderMarkupToByteStringIO |
64 | renderHtmlToByteStringIOT :: Monad m => (BS.ByteString -> IO ()) -> | ||
65 | MarkupT m a -> m (IO ()) | ||
66 | renderHtmlToByteStringIOT g = liftM (BU.renderMarkupToByteStringIO g) . execMarkupT | ||