Skip to content

Commit 5f4cef9

Browse files
committed
We unconditionally have hashable >= 1.2.5 now
1 parent 3d6f34f commit 5f4cef9

File tree

3 files changed

+3
-28
lines changed

3 files changed

+3
-28
lines changed

hnix.cabal

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ library
503503
, exceptions >= 0.10.0 && < 0.11
504504
, filepath >= 1.4.2 && < 1.5
505505
, free >= 5.1 && < 5.2
506+
, hashable >=1.2.5 && < 1.4
506507
, hashing >= 0.1.0 && < 0.2
507508
, hnix-store-core >= 0.1.0 && < 0.2
508509
, http-client >= 0.5.14 && < 0.6 || >= 0.6.4 && < 0.7
@@ -553,15 +554,11 @@ library
553554
-- if !flag(profiling)
554555
-- build-depends:
555556
-- ghc-datasize
556-
if impl(ghcjs)
557-
build-depends:
558-
hashable >=1.2.4 && <1.3 || >= 1.3.0.0 && < 1.4
559-
else
557+
if !impl(ghcjs)
560558
exposed-modules:
561559
Nix.Options.Parser
562560
build-depends:
563-
hashable >=1.2.5 && <1.3 || >= 1.3.0.0 && < 1.4
564-
, haskeline >= 0.7.4.2 && < 0.8
561+
haskeline >= 0.7.4.2 && < 0.8
565562
, pretty-show >= 1.9.5 && < 1.10
566563
default-language: Haskell2010
567564

src/Nix/Expr/Types.hs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ import Data.Eq.Deriving
4343
import Data.Fix
4444
import Data.Functor.Classes
4545
import Data.Hashable
46-
#if MIN_VERSION_hashable(1, 2, 5)
4746
import Data.Hashable.Lifted
48-
#endif
4947
import Data.List ( inits
5048
, tails
5149
)
@@ -77,9 +75,7 @@ hashAt :: VarName -> Lens' (AttrSet v) (Maybe v)
7775
hashAt = flip alterF
7876

7977
-- unfortunate orphans
80-
#if MIN_VERSION_hashable(1, 2, 5)
8178
instance Hashable1 NonEmpty
82-
#endif
8379

8480
#if !MIN_VERSION_binary(0, 8, 4)
8581
instance Binary a => Binary (NE.NonEmpty a) where
@@ -135,9 +131,7 @@ data NExprF r
135131
deriving (Ord, Eq, Generic, Generic1, Typeable, Data, Functor,
136132
Foldable, Traversable, Show, NFData, Hashable)
137133

138-
#if MIN_VERSION_hashable(1, 2, 5)
139134
instance Hashable1 NExprF
140-
#endif
141135

142136
#if MIN_VERSION_deepseq(1, 4, 3)
143137
instance NFData1 NExprF
@@ -178,9 +172,7 @@ data Binding r
178172
deriving (Generic, Generic1, Typeable, Data, Ord, Eq, Functor,
179173
Foldable, Traversable, Show, NFData, Hashable)
180174

181-
#if MIN_VERSION_hashable(1, 2, 5)
182175
instance Hashable1 Binding
183-
#endif
184176

185177
#if MIN_VERSION_deepseq(1, 4, 3)
186178
instance NFData1 Binding
@@ -202,9 +194,7 @@ data Params r
202194
deriving (Ord, Eq, Generic, Generic1, Typeable, Data, Functor, Show,
203195
Foldable, Traversable, NFData, Hashable)
204196

205-
#if MIN_VERSION_hashable(1, 2, 5)
206197
instance Hashable1 Params
207-
#endif
208198

209199
#if MIN_VERSION_deepseq(1, 4, 3)
210200
instance NFData1 Params
@@ -227,15 +217,13 @@ data Antiquoted (v :: *) (r :: *) = Plain !v | EscapedNewline | Antiquoted !r
227217
deriving (Ord, Eq, Generic, Generic1, Typeable, Data, Functor, Foldable,
228218
Traversable, Show, Read, NFData, Hashable)
229219

230-
#if MIN_VERSION_hashable(1, 2, 5)
231220
instance Hashable v => Hashable1 (Antiquoted v)
232221

233222
instance Hashable2 Antiquoted where
234223
liftHashWithSalt2 ha _ salt (Plain a) = ha (salt `hashWithSalt` (0 :: Int)) a
235224
liftHashWithSalt2 _ _ salt EscapedNewline = salt `hashWithSalt` (1 :: Int)
236225
liftHashWithSalt2 _ hb salt (Antiquoted b) =
237226
hb (salt `hashWithSalt` (2 :: Int)) b
238-
#endif
239227

240228
#if MIN_VERSION_deepseq(1, 4, 3)
241229
instance NFData v => NFData1 (Antiquoted v)
@@ -259,9 +247,7 @@ data NString r
259247
deriving (Eq, Ord, Generic, Generic1, Typeable, Data, Functor, Foldable,
260248
Traversable, Show, Read, NFData, Hashable)
261249

262-
#if MIN_VERSION_hashable(1, 2, 5)
263250
instance Hashable1 NString
264-
#endif
265251

266252
#if MIN_VERSION_deepseq(1, 4, 3)
267253
instance NFData1 NString
@@ -341,13 +327,11 @@ instance Eq1 NKeyName where
341327
liftEq _ (StaticKey a) (StaticKey b) = a == b
342328
liftEq _ _ _ = False
343329

344-
#if MIN_VERSION_hashable(1, 2, 5)
345330
instance Hashable1 NKeyName where
346331
liftHashWithSalt h salt (DynamicKey a) =
347332
liftHashWithSalt2 (liftHashWithSalt h) h (salt `hashWithSalt` (0 :: Int)) a
348333
liftHashWithSalt _ salt (StaticKey n) =
349334
salt `hashWithSalt` (1 :: Int) `hashWithSalt` n
350-
#endif
351335

352336
-- Deriving this instance automatically is not possible because @r@
353337
-- occurs not only as last argument in @Antiquoted (NString r) r@

src/Nix/Expr/Types/Annotated.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ import Data.Fix
3939
import Data.Function ( on )
4040
import Data.Functor.Compose
4141
import Data.Hashable
42-
#if MIN_VERSION_hashable(1, 2, 5)
4342
import Data.Hashable.Lifted
44-
#endif
4543
import Data.Ord.Deriving
4644
import Data.Text ( Text
4745
, pack
@@ -78,9 +76,7 @@ data Ann ann a = Ann
7876
deriving (Ord, Eq, Data, Generic, Generic1, Typeable, Functor, Foldable,
7977
Traversable, Read, Show, NFData, Hashable)
8078

81-
#if MIN_VERSION_hashable(1, 2, 5)
8279
instance Hashable ann => Hashable1 (Ann ann)
83-
#endif
8480

8581
#ifdef MIN_VERSION_serialise
8682
instance (Serialise ann, Serialise a) => Serialise (Ann ann a)
@@ -124,9 +120,7 @@ instance NFData NExprLoc
124120
instance Serialise NExprLoc
125121
#endif
126122

127-
#if MIN_VERSION_hashable(1, 2, 5)
128123
instance Hashable NExprLoc
129-
#endif
130124

131125
instance Binary SrcSpan
132126
instance (Binary ann, Binary a) => Binary (Ann ann a)

0 commit comments

Comments
 (0)