Skip to content

Commit 6f5b1b3

Browse files
committed
Try to fix travis
1 parent e19f0ee commit 6f5b1b3

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Data/Hashable/Class.hs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, MagicHash,
2-
ScopedTypeVariables, UnliftedFFITypes #-}
2+
ScopedTypeVariables, UnliftedFFITypes, DeriveDataTypeable #-}
33
#ifdef GENERICS
44
{-# LANGUAGE DefaultSignatures, FlexibleContexts, GADTs,
55
MultiParamTypeClasses, EmptyDataDecls #-}
@@ -68,7 +68,7 @@ import qualified Data.Text as T
6868
import qualified Data.Text.Array as TA
6969
import qualified Data.Text.Internal as T
7070
import qualified Data.Text.Lazy as TL
71-
import Data.Typeable
71+
import Data.Typeable (Typeable, TypeRep)
7272
import Data.Version (Version(..))
7373
import Data.Word (Word8, Word16, Word32, Word64)
7474
import Foreign.C (CString)
@@ -82,7 +82,10 @@ import System.IO.Unsafe (unsafePerformIO)
8282
import System.Mem.StableName
8383
import Data.Unique (Unique, hashUnique)
8484

85-
#if !(MIN_VERSION_base(4,7,0))
85+
-- As we use qualified F.Foldable, we don't get warnings with newer base
86+
import qualified Data.Foldable as F
87+
88+
#if MIN_VERSION_base(4,7,0)
8689
import Data.Proxy (Proxy)
8790
#endif
8891

@@ -92,8 +95,6 @@ import Data.Fixed (Fixed(..))
9295

9396
#if MIN_VERSION_base(4,8,0)
9497
import Data.Functor.Identity (Identity(..))
95-
#else
96-
import Data.Foldable (Foldable (..))
9798
#endif
9899

99100
#ifdef GENERICS
@@ -103,8 +104,9 @@ import GHC.Generics
103104
#if __GLASGOW_HASKELL__ >= 710
104105
import GHC.Fingerprint.Type(Fingerprint(..))
105106
#elif __GLASGOW_HASKELL__ >= 702
106-
import Data.Typeable.Internal(TypeRep(..))
107107
import GHC.Fingerprint.Type(Fingerprint(..))
108+
#elif __GLASGOW_HASKELL__ >= 606
109+
import Data.Typeable (typeRepKey)
108110
#endif
109111

110112
#if __GLASGOW_HASKELL__ >= 703
@@ -751,12 +753,14 @@ instance Hashable a => Hashable1 (Const a) where
751753
instance Hashable2 Const where
752754
liftHashWithSalt2 f _ salt (Const x) = f salt x
753755

756+
#if MIN_VERSION_base(4,7,0)
754757
instance Hashable (Proxy a) where
755758
hash _ = 0
756759
hashWithSalt s _ = s
757760

758761
instance Hashable1 Proxy where
759762
liftHashWithSalt _ s _ = s
763+
#endif
760764

761765
-- instances formerly provided by 'semigroups' package
762766
#if MIN_VERSION_base(4,9,0)
@@ -846,7 +850,7 @@ instance Hashable1 Hashed where
846850
instance (IsString a, Hashable a) => IsString (Hashed a) where
847851
fromString s = let r = fromString s in Hashed r (hash r)
848852

849-
instance Foldable Hashed where
853+
instance F.Foldable Hashed where
850854
foldr f acc (Hashed a _) = f a acc
851855

852856
-- | 'Hashed' cannot be 'Functor'

0 commit comments

Comments
 (0)