@@ -30,6 +30,13 @@ module Data.Tuple.Solo (
3030import Data.Orphans ()
3131#endif
3232
33+ #if defined(DEFINE_HASHABLE)
34+ #if !MIN_VERSION_hashable(1,3,5) || defined(__GLASGOW_HASKELL__)
35+ import Data.Hashable (Hashable (.. ))
36+ import Data.Hashable.Lifted (Hashable1 (.. ), hashWithSalt1 )
37+ #endif
38+ #endif
39+
3340#if defined(__MHS__)
3441import Data.Tuple (Solo (MkSolo ), getSolo )
3542
@@ -81,11 +88,6 @@ import qualified Data.Foldable1 as F1
8188
8289import Data.Functor.Classes (Eq1 (.. ), Ord1 (.. ), Show1 (.. ), Read1 (.. ))
8390
84- #if !(MIN_VERSION_base(4,15,0))
85- import Data.Hashable (Hashable (.. ))
86- import Data.Hashable.Lifted (Hashable1 (.. ), hashWithSalt1 )
87- #endif
88-
8991import Data.Functor.Classes (readData , readUnaryWith , liftReadListDefault , liftReadListPrecDefault )
9092import GHC.Generics (Generic , Generic1 )
9193import Control.Monad.Zip (MonadZip (.. ))
@@ -197,7 +199,8 @@ instance Show1 Solo where
197199 showString " MkSolo " . sp 11 x
198200#endif
199201
200- #if !(MIN_VERSION_base(4,15,0))
202+ #if defined(DEFINE_HASHABLE)
203+ #if !MIN_VERSION_hashable(1,3,5) || defined(__GLASGOW_HASKELL__)
201204-- | @since 0.3.1
202205instance Hashable a => Hashable (Solo a ) where
203206 hashWithSalt = hashWithSalt1
@@ -206,3 +209,4 @@ instance Hashable a => Hashable (Solo a) where
206209instance Hashable1 Solo where
207210 liftHashWithSalt h salt (MkSolo a) = h salt a
208211#endif
212+ #endif
0 commit comments