1
1
{-# LANGUAGE BangPatterns, CPP, ForeignFunctionInterface, MagicHash,
2
- ScopedTypeVariables, UnliftedFFITypes #-}
2
+ ScopedTypeVariables, UnliftedFFITypes, DeriveDataTypeable #-}
3
3
#ifdef GENERICS
4
4
{-# LANGUAGE DefaultSignatures, FlexibleContexts, GADTs,
5
5
MultiParamTypeClasses, EmptyDataDecls #-}
@@ -68,7 +68,7 @@ import qualified Data.Text as T
68
68
import qualified Data.Text.Array as TA
69
69
import qualified Data.Text.Internal as T
70
70
import qualified Data.Text.Lazy as TL
71
- import Data.Typeable
71
+ import Data.Typeable ( Typeable , TypeRep )
72
72
import Data.Version (Version (.. ))
73
73
import Data.Word (Word8 , Word16 , Word32 , Word64 )
74
74
import Foreign.C (CString )
@@ -82,7 +82,10 @@ import System.IO.Unsafe (unsafePerformIO)
82
82
import System.Mem.StableName
83
83
import Data.Unique (Unique , hashUnique )
84
84
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)
86
89
import Data.Proxy (Proxy )
87
90
#endif
88
91
@@ -92,8 +95,6 @@ import Data.Fixed (Fixed(..))
92
95
93
96
#if MIN_VERSION_base(4,8,0)
94
97
import Data.Functor.Identity (Identity (.. ))
95
- #else
96
- import Data.Foldable (Foldable (.. ))
97
98
#endif
98
99
99
100
#ifdef GENERICS
@@ -103,8 +104,9 @@ import GHC.Generics
103
104
#if __GLASGOW_HASKELL__ >= 710
104
105
import GHC.Fingerprint.Type (Fingerprint (.. ))
105
106
#elif __GLASGOW_HASKELL__ >= 702
106
- import Data.Typeable.Internal (TypeRep (.. ))
107
107
import GHC.Fingerprint.Type (Fingerprint (.. ))
108
+ #elif __GLASGOW_HASKELL__ >= 606
109
+ import Data.Typeable (typeRepKey )
108
110
#endif
109
111
110
112
#if __GLASGOW_HASKELL__ >= 703
@@ -751,12 +753,14 @@ instance Hashable a => Hashable1 (Const a) where
751
753
instance Hashable2 Const where
752
754
liftHashWithSalt2 f _ salt (Const x) = f salt x
753
755
756
+ #if MIN_VERSION_base(4,7,0)
754
757
instance Hashable (Proxy a ) where
755
758
hash _ = 0
756
759
hashWithSalt s _ = s
757
760
758
761
instance Hashable1 Proxy where
759
762
liftHashWithSalt _ s _ = s
763
+ #endif
760
764
761
765
-- instances formerly provided by 'semigroups' package
762
766
#if MIN_VERSION_base(4,9,0)
@@ -846,7 +850,7 @@ instance Hashable1 Hashed where
846
850
instance (IsString a , Hashable a ) => IsString (Hashed a ) where
847
851
fromString s = let r = fromString s in Hashed r (hash r)
848
852
849
- instance Foldable Hashed where
853
+ instance F. Foldable Hashed where
850
854
foldr f acc (Hashed a _) = f a acc
851
855
852
856
-- | 'Hashed' cannot be 'Functor'
0 commit comments