diff --git a/Data/Text/Buildable.hs b/Data/Text/Buildable.hs index 4888eb4..c810db8 100644 --- a/Data/Text/Buildable.hs +++ b/Data/Text/Buildable.hs @@ -37,6 +37,9 @@ import Foreign.Ptr (IntPtr, WordPtr, Ptr, ptrToWordPtr) import qualified Data.Double.Conversion.Text as C import qualified Data.Text as ST import qualified Data.Text.Lazy as LT +#if MIN_VERSION_base(4,11,0) +import Prelude hiding ((<>)) +#endif -- | The class of types that can be rendered to a 'Builder'. class Buildable p where diff --git a/Data/Text/Format.hs b/Data/Text/Format.hs index 7a7f725..6363f15 100644 --- a/Data/Text/Format.hs +++ b/Data/Text/Format.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE OverloadedStrings, RelaxedPolyRec #-} +{-# LANGUAGE CPP, OverloadedStrings, RelaxedPolyRec #-} -- | -- Module : Data.Text.Format @@ -41,7 +41,11 @@ import Data.Text.Format.Params (Params(..)) import Data.Text.Format.Types.Internal (Format(..), Only(..), Shown(..)) import Data.Text.Format.Types.Internal (Hex(..)) import Data.Text.Lazy.Builder -import Prelude hiding (exp, print) +import Prelude hiding (exp, print +#if MIN_VERSION_base(4,11,0) + , (<>) +#endif + ) import System.IO (Handle) import qualified Data.Double.Conversion.Text as C import qualified Data.Text as ST diff --git a/Data/Text/Format/Functions.hs b/Data/Text/Format/Functions.hs index f10dd77..795d856 100644 --- a/Data/Text/Format/Functions.hs +++ b/Data/Text/Format/Functions.hs @@ -13,7 +13,7 @@ module Data.Text.Format.Functions ( - (<>) + (Data.Text.Format.Functions.<>) , i2d ) where diff --git a/Data/Text/Format/Int.hs b/Data/Text/Format/Int.hs index 37858c9..5af6158 100644 --- a/Data/Text/Format/Int.hs +++ b/Data/Text/Format/Int.hs @@ -24,6 +24,9 @@ import Data.Word (Word, Word8, Word16, Word32, Word64) import GHC.Base (quotInt, remInt) import GHC.Num (quotRemInteger) import GHC.Types (Int(..)) +#if MIN_VERSION_base(4,11,0) +import Prelude hiding ((<>)) +#endif #ifdef __GLASGOW_HASKELL__ # if __GLASGOW_HASKELL__ < 611 diff --git a/Data/Text/Format/Types/Internal.hs b/Data/Text/Format/Types/Internal.hs index 2eaccb2..c39e111 100644 --- a/Data/Text/Format/Types/Internal.hs +++ b/Data/Text/Format/Types/Internal.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-} +{-# LANGUAGE CPP, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} -- | -- Module : Data.Text.Format.Types.Internal @@ -47,8 +47,13 @@ newtype Format = Format { fromFormat :: Text } deriving (Eq, Ord, Typeable, Show) instance Monoid Format where - Format a `mappend` Format b = Format (a `mappend` b) mempty = Format mempty +#if !MIN_VERSION_base(4,11,0) + Format a `mappend` Format b = Format (a `mappend` b) +#else +instance Semigroup Format where + Format a <> Format b = Format (a <> b) +#endif instance IsString Format where fromString = Format . fromString