Skip to content

Commit c3cc3ee

Browse files
committed
Adapt module imports to accomodate future base-4.8
There's only one breaking change in `base-4.8.0.0` so far, namely that `Prelude` now re-exports `traverse` which clashes with `Data.HashMap.Array.traverse`. All other changes in this commit are to avoid redundant-import warnings.
1 parent b0256dc commit c3cc3ee

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Data/HashMap/Array.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ module Data.HashMap.Array
4949
) where
5050

5151
import qualified Data.Traversable as Traversable
52+
#if __GLASGOW_HASKELL__ < 709
5253
import Control.Applicative (Applicative)
54+
#endif
5355
import Control.DeepSeq
5456
import Control.Monad.ST hiding (runST)
5557
-- GHC 7.7 exports toList/fromList from GHC.Exts
@@ -59,7 +61,12 @@ import GHC.Exts (Array#, Int(..), newArray#, readArray#, writeArray#,
5961
indexArray#, unsafeFreezeArray#, unsafeThawArray#,
6062
MutableArray#)
6163
import GHC.ST (ST(..))
64+
65+
#if __GLASGOW_HASKELL__ >= 709
66+
import Prelude hiding (filter, foldr, length, map, read, traverse)
67+
#else
6268
import Prelude hiding (filter, foldr, length, map, read)
69+
#endif
6370

6471
#if __GLASGOW_HASKELL__ >= 702
6572
import GHC.Exts (sizeofArray#, copyArray#, thawArray#, sizeofMutableArray#,

Data/HashMap/Base.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,20 @@ module Data.HashMap.Base
8181
, updateOrConcatWith
8282
) where
8383

84+
#if __GLASGOW_HASKELL__ >= 709
85+
import Data.Functor ((<$>))
86+
#else
8487
import Control.Applicative ((<$>), Applicative(pure))
88+
import Data.Monoid (Monoid(mempty, mappend))
89+
import Data.Traversable (Traversable(..))
90+
import Data.Word (Word)
91+
#endif
8592
import Control.DeepSeq (NFData(rnf))
8693
import Control.Monad.ST (ST)
8794
import Data.Bits ((.&.), (.|.), complement)
8895
import Data.Data hiding (Typeable)
8996
import qualified Data.Foldable as Foldable
9097
import qualified Data.List as L
91-
import Data.Monoid (Monoid(mempty, mappend))
92-
import Data.Traversable (Traversable(..))
93-
import Data.Word (Word)
9498
import GHC.Exts ((==#), build, reallyUnsafePtrEquality#)
9599
import Prelude hiding (filter, foldr, lookup, map, null, pred)
96100
import Text.Read hiding (step)

Data/HashSet.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ import Control.DeepSeq (NFData(..))
6666
import Data.Data hiding (Typeable)
6767
import Data.HashMap.Base (HashMap, foldrWithKey)
6868
import Data.Hashable (Hashable)
69+
#if __GLASGOW_HASKELL__ < 709
6970
import Data.Monoid (Monoid(..))
71+
#endif
7072
import GHC.Exts (build)
7173
import Prelude hiding (filter, foldr, map, null)
7274
import qualified Data.Foldable as Foldable

0 commit comments

Comments
 (0)