From 3db60b162a1e8482bb60f7638347de4cd7dc36f2 Mon Sep 17 00:00:00 2001 From: Adrien Duclos Date: Fri, 30 Nov 2018 11:36:53 +0100 Subject: Bump to LTS 12.20 --- src/Text/BlazeT/Internal.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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 wrapMarkup2 = wrapMarkupT2 {-# INLINE wrapMarkup2 #-} +#if MIN_VERSION_base(4,11,0) +instance (Monad m,Monoid a) => Semigroup (MarkupT m a) where + a <> b = do {a' <- a; b >>= return . (mappend a')} + {-# INLINE (<>) #-} +#endif -instance (Monad m,Monoid a) => Monoid (MarkupT m a) where +instance (Functor m, Monad m,Monoid a) => Monoid (MarkupT m a) where mempty = return mempty - {-# INLINE mempty #-} - a `mappend` b = do {a' <- a; b >>= return . (mappend a')} + a `mappend` b = do {a' <- a; fmap (mappend a') b} {-# INLINE mappend #-} - + {-# INLINE mempty #-} instance Monad m => Text.Blaze.Attributable (MarkupT m a) where h ! a = wrapMarkupT2 (Text.Blaze.! a) h -- cgit v1.2.3