@@ -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__) && !MIN_VERSION_base(4,15,0))
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
@@ -87,11 +94,6 @@ import qualified Data.Foldable1 as F1
8794
8895import Data.Functor.Classes (Eq1 (.. ), Ord1 (.. ), Show1 (.. ), Read1 (.. ))
8996
90- #if !(MIN_VERSION_base(4,15,0))
91- import Data.Hashable (Hashable (.. ))
92- import Data.Hashable.Lifted (Hashable1 (.. ), hashWithSalt1 )
93- #endif
94-
9597import Data.Functor.Classes (readData , readUnaryWith , liftReadListDefault , liftReadListPrecDefault )
9698import GHC.Generics (Generic , Generic1 )
9799import Control.Monad.Zip (MonadZip (.. ))
@@ -203,7 +205,8 @@ instance Show1 Solo where
203205 showString " MkSolo " . sp 11 x
204206#endif
205207
206- #if !(MIN_VERSION_base(4,15,0))
208+ #if defined(DEFINE_HASHABLE)
209+ #if !MIN_VERSION_hashable(1,3,5) || (defined(__GLASGOW_HASKELL__) && !MIN_VERSION_base(4,15,0))
207210-- | @since 0.3.1
208211instance Hashable a => Hashable (Solo a ) where
209212 hashWithSalt = hashWithSalt1
@@ -212,3 +215,4 @@ instance Hashable a => Hashable (Solo a) where
212215instance Hashable1 Solo where
213216 liftHashWithSalt h salt (MkSolo a) = h salt a
214217#endif
218+ #endif
0 commit comments