]> git.immae.eu Git - github/fretlink/blazeT.git/commitdiff
fixed compilation error for GHC 7.6.3, 7.8.4, 7.10.3 v0.0.2
authorJohannes Gerer <oss@johannesgerer.com>
Thu, 27 Oct 2016 00:46:07 +0000 (02:46 +0200)
committerJohannes Gerer <oss@johannesgerer.com>
Thu, 27 Oct 2016 00:47:19 +0000 (02:47 +0200)
blazeT.cabal
src/Text/BlazeT/Internal.hs
src/Text/BlazeT/Renderer/Pretty.hs
src/Text/BlazeT/Renderer/String.hs
src/Text/BlazeT/Renderer/Text.hs
src/Text/BlazeT/Renderer/Utf8.hs

index eb3907e0eca247b8ca4f3976177dd8d58a32099b..42e44ba11bb0b3a1b629134837d9fd77eaa03f56 100644 (file)
@@ -1,5 +1,5 @@
 Name:             blazeT
-Version:          0.0.1
+Version:          0.0.2
 Homepage:
 Bug-Reports:      http://github.com/johannesgerer/blazeT/issues
 License:          MIT
index aa5634729f67c9e8c27cca2e6cfb5a3f4526c437..1a2fe8c0227272ae380cb58c26cd056767d40642 100644 (file)
@@ -146,15 +146,15 @@ runMarkupT = runWriterT . fromMarkupT
 -- | run the MarkupT and return a pair consisting of the result of the
 -- computation and the blaze markup rendered with a blaze renderer
 -- like 'Text.BlazeT.Renderer.Text.renderHtml'
-runWith :: Monad m => (Markup -> c) -> MarkupT m a -> m (a, c)
-runWith renderer =  liftM (second $ \x -> renderer $ wrapMarkup x) . runMarkupT  
+runWith :: Monad m => (MarkupI () -> c) -> MarkupT m a -> m (a, c)
+runWith renderer =  liftM (second $ renderer . wrapMarkup) . runMarkupT  
 {-# INLINE runWith #-}
   
 execMarkupT :: Monad m => MarkupT m a -> m Text.Blaze.Markup
 execMarkupT = liftM snd . runMarkupT
 {-# INLINE execMarkupT #-}
 
-execWith :: Monad m => (Markup -> c) -> MarkupT m a -> m c
+execWith :: Monad m => (MarkupI () -> c) -> MarkupT m a -> m c
 execWith renderer = liftM snd . runWith renderer
 {-# INLINE execWith #-}
 
@@ -166,26 +166,6 @@ execMarkup :: MarkupI a -> Text.Blaze.Markup
 execMarkup = snd . runMarkup
 {-# INLINE execMarkup #-}
 
-
-instance (Monad m,Monoid a) => Monoid (MarkupT m a) where
-  mempty = return mempty
-  {-# INLINE mempty #-}
-  a `mappend` b = do {a' <- a; b >>= return . (mappend a')}
-  {-# INLINE mappend #-}
-
-
-instance Monad m => Text.Blaze.Attributable (MarkupT m a) where
-  h ! a = wrapMarkupT2 (Text.Blaze.! a) h
-  {-# INLINE (!) #-}
-
-instance Monad m => Text.Blaze.Attributable (a -> MarkupT m b) where
-  h ! a = \x -> wrapMarkupT2 (Text.Blaze.! a) $ h x
-  {-# INLINE (!) #-}
-
-instance Monad m => IsString (MarkupT m ()) where
-  fromString = wrapMarkup . fromString
-  {-# INLINE fromString #-}
-
 -- | Wrapper for 'Text.Blaze.Markup' is simply
 -- 'tell'
 wrapMarkupT :: Monad m => Text.Blaze.Markup -> MarkupT m ()
@@ -208,6 +188,26 @@ wrapMarkup2 :: (Text.Blaze.Markup -> Text.Blaze.Markup) -> Markup2
 wrapMarkup2 = wrapMarkupT2
 {-# INLINE wrapMarkup2 #-}
 
+
+instance (Monad m,Monoid a) => Monoid (MarkupT m a) where
+  mempty = return mempty
+  {-# INLINE mempty #-}
+  a `mappend` b = do {a' <- a; b >>= return . (mappend a')}
+  {-# INLINE mappend #-}
+
+
+instance Monad m => Text.Blaze.Attributable (MarkupT m a) where
+  h ! a = wrapMarkupT2 (Text.Blaze.! a) h
+  {-# INLINE (!) #-}
+
+instance Monad m => Text.Blaze.Attributable (a -> MarkupT m b) where
+  h ! a = \x -> wrapMarkupT2 (Text.Blaze.! a) $ h x
+  {-# INLINE (!) #-}
+
+instance Monad m => IsString (MarkupT m ()) where
+  fromString = wrapMarkup . fromString
+  {-# INLINE fromString #-}
+
 unsafeByteString :: BS.ByteString -> Markup
 unsafeByteString = wrapMarkup . Text.Blaze.unsafeByteString
 {-# INLINE unsafeByteString #-}
index 5e033ac79b7a6b31773b3660454196ff3b491b25..4fc77b75c4996aa54f3e4567a6d363ab1914cf40 100644 (file)
@@ -7,9 +7,9 @@ module Text.BlazeT.Renderer.Pretty
 import qualified Text.Blaze.Renderer.Pretty as BU
 import           Text.BlazeT
 
-renderMarkup :: MarkupM a -> String
+renderMarkup :: MarkupI a -> String
 renderMarkup = BU.renderMarkup . execMarkup
 
-renderHtml :: MarkupM a -> String
+renderHtml :: MarkupI a -> String
 renderHtml = renderMarkup
 
index 45c4786a774b04f7a5f697d3fa9c9e005f11b07c..615abbc1cde216cfe1808313e9fb147b0253d36f 100644 (file)
@@ -12,9 +12,9 @@ import           Text.BlazeT
 fromChoiceString :: ChoiceString -> String -> String       
 fromChoiceString = BU.fromChoiceString
 
-renderMarkup :: MarkupM a -> String
+renderMarkup :: MarkupI a -> String
 renderMarkup = BU.renderMarkup . execMarkup
 
-renderHtml :: MarkupM a -> String
+renderHtml :: MarkupI a -> String
 renderHtml = renderMarkup
 
index a595bd164b64fb673fc3d90ce0bba6534d579d10..5e5583c25147fb610cd846c1c6a00d435994344d 100644 (file)
@@ -18,27 +18,27 @@ 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 :: MarkupI a -> B.Builder
 renderMarkupBuilder = BU.renderMarkupBuilder . execMarkup
 
-renderHtmlBuilder :: MarkupM a -> B.Builder
+renderHtmlBuilder :: MarkupI a -> B.Builder
 renderHtmlBuilder = renderMarkupBuilder
 
-renderMarkup :: MarkupM a -> L.Text
+renderMarkup :: MarkupI a -> L.Text
 renderMarkup = BU.renderMarkup . execMarkup
 
-renderHtml :: MarkupM a -> L.Text
+renderHtml :: MarkupI a -> L.Text
 renderHtml = renderMarkup
 
-renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text
+renderMarkupWith :: (ByteString -> Text) -> MarkupI a -> L.Text
 renderMarkupWith g = (BH.renderHtmlWith g) . execMarkup
 
-renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text
+renderHtmlWith :: (ByteString -> Text) -> MarkupI a -> L.Text
 renderHtmlWith = renderMarkupWith
 
-renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
+renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupI a -> B.Builder
 renderMarkupBuilderWith g = (BU.renderMarkupBuilderWith g) . execMarkup
 
-renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder
+renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupI a -> B.Builder
 renderHtmlBuilderWith = renderHtmlBuilderWith
 
index 2874b68be27cc816c6bbf2d40afea2f2377f13f8..3862a2b8a542da228220a91224912fe0baf25b77 100644 (file)
@@ -22,20 +22,20 @@ import qualified Data.ByteString.Lazy as BL
 import qualified Text.Blaze.Renderer.Utf8 as BU
 import           Text.BlazeT
 
-renderMarkupBuilder :: MarkupM a -> B.Builder
+renderMarkupBuilder :: MarkupI a -> B.Builder
 renderMarkupBuilder = BU.renderMarkupBuilder . execMarkup
 
-renderHtmlBuilder :: MarkupM a -> B.Builder
+renderHtmlBuilder :: MarkupI a -> B.Builder
 renderHtmlBuilder = renderMarkupBuilder
 
-renderMarkup :: MarkupM a -> BL.ByteString
+renderMarkup :: MarkupI a -> BL.ByteString
 renderMarkup = BU.renderMarkup . execMarkup
 
-renderHtml :: MarkupM a -> BL.ByteString
+renderHtml :: MarkupI a -> BL.ByteString
 renderHtml = renderMarkup
 
-renderMarkupToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO ()
+renderMarkupToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupI a -> IO ()
 renderMarkupToByteStringIO g = BU.renderMarkupToByteStringIO g . execMarkup
 
-renderHtmlToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO ()
+renderHtmlToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupI a -> IO ()
 renderHtmlToByteStringIO = renderMarkupToByteStringIO