on master help sign in
Kill several redundant-import warnings

This refactoring avoids adding any additional evil CPP This has been tested across all major GHC 7.* releases, as well as GHC HEAD-soon-to-be-8.0

commit620a3af6cb4612280e4d11ad664c7a4f74577c55 authorHerbert Valerio Riedel <hvr@gnu.org> dateMon 21 Dec 2015, 10:10 (11 years ago) parent94334cc
7 files changed+12−11
Data/Text/Internal/Builder.hs+1−1 Data/Text/Internal/Builder/Functions.hs+2−1 Data/Text/Internal/Read.hs+2−2 Data/Text/Lazy/Builder/Int.hs+3−3 Data/Text/Lazy/Encoding.hs+2−2 Data/Text/Lazy/Read.hs+1−1 Data/Text/Read.hs+1−1
Data/Text/Internal/Builder.hs+1−1
@@ -94,7 +94,7 @@ instance Monoid Builder where
9494 {-# INLINE mempty #-}
9595 mappend = append
9696 {-# INLINE mappend #-}
97− mconcat = foldr mappend mempty
97+ mconcat = foldr mappend Data.Monoid.mempty
9898 {-# INLINE mconcat #-}
9999
100100instance String.IsString Builder where
Data/Text/Internal/Builder/Functions.hs+2−1
@@ -23,7 +23,8 @@ module Data.Text.Internal.Builder.Functions
2323
2424import Data.Monoid (mappend)
2525import Data.Text.Lazy.Builder (Builder)
26−import GHC.Base
26+import GHC.Base (chr#,ord#,(+#),Int(I#),Char(C#))
27+import Prelude ()
2728
2829-- | Unsafe conversion for decimal digits.
2930{-# INLINE i2d #-}
Data/Text/Internal/Read.hs+2−2
@@ -18,7 +18,7 @@ module Data.Text.Internal.Read
1818 , perhaps
1919 ) where
2020
21−import Control.Applicative (Applicative(..))
21+import Control.Applicative as App (Applicative(..))
2222import Control.Arrow (first)
2323import Control.Monad (ap)
2424import Data.Char (ord)
@@ -38,7 +38,7 @@ instance Applicative (IParser t) where
3838 (<*>) = ap
3939
4040instance Monad (IParser t) where
41− return = pure
41+ return = App.pure
4242 m >>= k = P $ \t -> case runP m t of
4343 Left err -> Left err
4444 Right (a,t') -> runP (k a) t'
Data/Text/Lazy/Builder/Int.hs+3−3
@@ -35,7 +35,7 @@ import Control.Monad.ST
3535
3636#ifdef __GLASGOW_HASKELL__
3737# if defined(INTEGER_GMP)
38−import GHC.Integer.GMP.Internals
38+import GHC.Integer.GMP.Internals (Integer(S#))
3939# elif defined(INTEGER_SIMPLE)
4040import GHC.Integer
4141# else
@@ -55,7 +55,7 @@ decimal :: Integral a => a -> Builder
5555{-# RULES "decimal/Int16" decimal = boundedDecimal :: Int16 -> Builder #-}
5656{-# RULES "decimal/Int32" decimal = boundedDecimal :: Int32 -> Builder #-}
5757{-# RULES "decimal/Int64" decimal = boundedDecimal :: Int64 -> Builder #-}
58−{-# RULES "decimal/Word" decimal = positive :: Word -> Builder #-}
58+{-# RULES "decimal/Word" decimal = positive :: Data.Word.Word -> Builder #-}
5959{-# RULES "decimal/Word8" decimal = positive :: Word8 -> Builder #-}
6060{-# RULES "decimal/Word16" decimal = positive :: Word16 -> Builder #-}
6161{-# RULES "decimal/Word32" decimal = positive :: Word32 -> Builder #-}
@@ -247,7 +247,7 @@ integer base i
247247 PAIR(x,y) -> pblock q <> pblock r <> putB ns
248248 where q = fromInteger x
249249 r = fromInteger y
250− putB _ = mempty
250+ putB _ = Data.Monoid.mempty
251251
252252 int :: Int -> Builder
253253 int x | base == 10 = decimal x
Data/Text/Lazy/Encoding.hs+2−2
@@ -62,7 +62,7 @@ import qualified Data.ByteString.Lazy.Internal as B
6262import qualified Data.ByteString.Unsafe as B
6363#if MIN_VERSION_bytestring(0,10,4)
6464import Data.Word (Word8)
65−import Data.Monoid (mappend, mempty)
65+import Data.Monoid (Monoid(..))
6666import qualified Data.ByteString.Builder as B
6767import qualified Data.ByteString.Builder.Extra as B (safeStrategy, toLazyByteStringWith)
6868import qualified Data.ByteString.Builder.Prim as BP
@@ -161,7 +161,7 @@ encodeUtf8 lt@(Chunk t _) =
161161
162162encodeUtf8Builder :: Text -> B.Builder
163163encodeUtf8Builder =
164− foldrChunks (\c b -> TE.encodeUtf8Builder c `mappend` b) mempty
164+ foldrChunks (\c b -> TE.encodeUtf8Builder c `mappend` b) Data.Monoid.mempty
165165
166166{-# INLINE encodeUtf8BuilderEscaped #-}
167167encodeUtf8BuilderEscaped :: BP.BoundedPrim Word8 -> Text -> B.Builder
Data/Text/Lazy/Read.hs+1−1
@@ -56,7 +56,7 @@ decimal :: Integral a => Reader a
5656{-# SPECIALIZE decimal :: Reader Int32 #-}
5757{-# SPECIALIZE decimal :: Reader Int64 #-}
5858{-# SPECIALIZE decimal :: Reader Integer #-}
59−{-# SPECIALIZE decimal :: Reader Word #-}
59+{-# SPECIALIZE decimal :: Reader Data.Word.Word #-}
6060{-# SPECIALIZE decimal :: Reader Word8 #-}
6161{-# SPECIALIZE decimal :: Reader Word16 #-}
6262{-# SPECIALIZE decimal :: Reader Word32 #-}
Data/Text/Read.hs+1−1
@@ -55,7 +55,7 @@ decimal :: Integral a => Reader a
5555{-# SPECIALIZE decimal :: Reader Int32 #-}
5656{-# SPECIALIZE decimal :: Reader Int64 #-}
5757{-# SPECIALIZE decimal :: Reader Integer #-}
58−{-# SPECIALIZE decimal :: Reader Word #-}
58+{-# SPECIALIZE decimal :: Reader Data.Word.Word #-}
5959{-# SPECIALIZE decimal :: Reader Word8 #-}
6060{-# SPECIALIZE decimal :: Reader Word16 #-}
6161{-# SPECIALIZE decimal :: Reader Word32 #-}