Skip to content

Commit 7910f69

Browse files
committed
Try to fix travis
1 parent e19f0ee commit 7910f69

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Data/Hashable/Class.hs

Lines changed: 13 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,19 +95,20 @@ 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
100101
import GHC.Generics
101102
#endif
102103

103104
#if __GLASGOW_HASKELL__ >= 710
105+
import Data.Typeable (typeRepFingerprint)
104106
import GHC.Fingerprint.Type(Fingerprint(..))
105107
#elif __GLASGOW_HASKELL__ >= 702
106-
import Data.Typeable.Internal(TypeRep(..))
108+
import Data.Typeable (TypeRep (..))
107109
import GHC.Fingerprint.Type(Fingerprint(..))
110+
#elif __GLASGOW_HASKELL__ >= 606
111+
import Data.Typeable (typeRepKey)
108112
#endif
109113

110114
#if __GLASGOW_HASKELL__ >= 703
@@ -751,12 +755,14 @@ instance Hashable a => Hashable1 (Const a) where
751755
instance Hashable2 Const where
752756
liftHashWithSalt2 f _ salt (Const x) = f salt x
753757

758+
#if MIN_VERSION_base(4,7,0)
754759
instance Hashable (Proxy a) where
755760
hash _ = 0
756761
hashWithSalt s _ = s
757762

758763
instance Hashable1 Proxy where
759764
liftHashWithSalt _ s _ = s
765+
#endif
760766

761767
-- instances formerly provided by 'semigroups' package
762768
#if MIN_VERSION_base(4,9,0)
@@ -846,7 +852,7 @@ instance Hashable1 Hashed where
846852
instance (IsString a, Hashable a) => IsString (Hashed a) where
847853
fromString s = let r = fromString s in Hashed r (hash r)
848854

849-
instance Foldable Hashed where
855+
instance F.Foldable Hashed where
850856
foldr f acc (Hashed a _) = f a acc
851857

852858
-- | 'Hashed' cannot be 'Functor'

0 commit comments

Comments
 (0)