Skip to content

SMP / GHC 8.4 compat #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Data/Text/Buildable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions Data/Text/Format.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE OverloadedStrings, RelaxedPolyRec #-}
{-# LANGUAGE CPP, OverloadedStrings, RelaxedPolyRec #-}

-- |
-- Module : Data.Text.Format
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Data/Text/Format/Functions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

module Data.Text.Format.Functions
(
(<>)
(Data.Text.Format.Functions.<>)
, i2d
) where

Expand Down
3 changes: 3 additions & 0 deletions Data/Text/Format/Int.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions Data/Text/Format/Types/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
{-# LANGUAGE CPP, DeriveDataTypeable, GeneralizedNewtypeDeriving #-}

-- |
-- Module : Data.Text.Format.Types.Internal
Expand Down Expand Up @@ -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
Expand Down