aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/BlazeT/Internal.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Text/BlazeT/Internal.hs b/src/Text/BlazeT/Internal.hs
index f6f642a..feaf68f 100644
--- a/src/Text/BlazeT/Internal.hs
+++ b/src/Text/BlazeT/Internal.hs
@@ -188,13 +188,17 @@ wrapMarkup2 :: (Text.Blaze.Markup -> Text.Blaze.Markup) -> Markup2
188wrapMarkup2 = wrapMarkupT2 188wrapMarkup2 = wrapMarkupT2
189{-# INLINE wrapMarkup2 #-} 189{-# INLINE wrapMarkup2 #-}
190 190
191#if MIN_VERSION_base(4,11,0)
192instance (Monad m,Monoid a) => Semigroup (MarkupT m a) where
193 a <> b = do {a' <- a; b >>= return . (mappend a')}
194 {-# INLINE (<>) #-}
195#endif
191 196
192instance (Monad m,Monoid a) => Monoid (MarkupT m a) where 197instance (Functor m, Monad m,Monoid a) => Monoid (MarkupT m a) where
193 mempty = return mempty 198 mempty = return mempty
194 {-# INLINE mempty #-} 199 a `mappend` b = do {a' <- a; fmap (mappend a') b}
195 a `mappend` b = do {a' <- a; b >>= return . (mappend a')}
196 {-# INLINE mappend #-} 200 {-# INLINE mappend #-}
197 201 {-# INLINE mempty #-}
198 202
199instance Monad m => Text.Blaze.Attributable (MarkupT m a) where 203instance Monad m => Text.Blaze.Attributable (MarkupT m a) where
200 h ! a = wrapMarkupT2 (Text.Blaze.! a) h 204 h ! a = wrapMarkupT2 (Text.Blaze.! a) h