-Werror free on GHC-8.8

This commit is contained in:
Oleg Grenrus 2019-11-02 13:35:52 +02:00
parent 5d043addb0
commit bb2b053e46

View file

@ -40,9 +40,7 @@ import Data.ByteString.Lazy (ByteString)
import Data.Hashable (Hashable(..)) import Data.Hashable (Hashable(..))
import Data.HashMap.Strict (HashMap) import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as M import qualified Data.HashMap.Strict as M
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (Monoid(..)) import Data.Monoid (Monoid(..))
#endif
import Data.Semigroup (Semigroup(..)) import Data.Semigroup (Semigroup(..))
import Data.String import Data.String
import Data.Text (Text) import Data.Text (Text)
@ -65,10 +63,13 @@ newtype Element = Element (HashMap Text Text -> Builder)
instance Show Element where instance Show Element where
show e = LT.unpack . renderText $ e show e = LT.unpack . renderText $ e
instance Semigroup Element where -- using qualified name we make the import not redundant,
-- even when Semigroup or Monoid are in Prelude
instance Data.Semigroup.Semigroup Element where
Element e1 <> Element e2 = Element (e1 <> e2) Element e1 <> Element e2 = Element (e1 <> e2)
instance Monoid Element where instance Data.Monoid.Monoid Element where
mempty = Element mempty mempty = Element mempty
#if !(MIN_VERSION_base(4,11,0)) #if !(MIN_VERSION_base(4,11,0))
mappend = (<>) mappend = (<>)