Skip to content

Commit d163c64

Browse files
committed
Value: m clean-up
1 parent 130c9c7 commit d163c64

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/Nix/Value.hs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ data NValueF p m r
144144
instance Eq1 (NValueF p m) where
145145
liftEq _ (NVConstantF x) (NVConstantF y) = x == y
146146
liftEq _ (NVStrF x) (NVStrF y) = x == y
147+
liftEq _ (NVPathF x) (NVPathF y) = x == y
147148
liftEq eq (NVListF x) (NVListF y) = liftEq eq x y
148149
liftEq eq (NVSetF _ x) (NVSetF _ y) = liftEq eq x y
149-
liftEq _ (NVPathF x) (NVPathF y) = x == y
150150
liftEq _ _ _ = False
151151

152152

@@ -176,10 +176,10 @@ instance Foldable (NValueF p m) where
176176
NVConstantF _ -> mempty
177177
NVStrF _ -> mempty
178178
NVPathF _ -> mempty
179-
NVListF l -> foldMap f l
180-
NVSetF _ s -> foldMap f s
181179
NVClosureF _ _ -> mempty
182180
NVBuiltinF _ _ -> mempty
181+
NVListF l -> foldMap f l
182+
NVSetF _ s -> foldMap f s
183183

184184

185185
-- ** Traversable
@@ -283,13 +283,13 @@ instance (Comonad f, Show a) => Show (NValue' t f m a) where
283283

284284
instance Comonad f => Show1 (NValue' t f m) where
285285
liftShowsPrec sp sl p = \case
286-
NVConstant' atom -> showsUnaryWith showsPrec "NVConstantF" p atom
287-
NVStr' ns -> showsUnaryWith showsPrec "NVStrF" p $ ignoreContext ns
288-
NVList' lst -> showsUnaryWith (liftShowsPrec sp sl) "NVListF" p lst
289-
NVSet' _ attrs -> showsUnaryWith (liftShowsPrec sp sl) "NVSetF" p attrs
290-
NVPath' path -> showsUnaryWith showsPrec "NVPathF" p path
291-
NVClosure' c _ -> showsUnaryWith showsPrec "NVClosureF" p c
292-
NVBuiltin' name _ -> showsUnaryWith showsPrec "NVBuiltinF" p name
286+
NVConstant' atom -> showsUnaryWith showsPrec "NVConstantF" p atom
287+
NVStr' ns -> showsUnaryWith showsPrec "NVStrF" p $ ignoreContext ns
288+
NVList' lst -> showsUnaryWith (liftShowsPrec sp sl) "NVListF" p lst
289+
NVSet' _ attrs -> showsUnaryWith (liftShowsPrec sp sl) "NVSetF" p attrs
290+
NVPath' path -> showsUnaryWith showsPrec "NVPathF" p path
291+
NVClosure' c _ -> showsUnaryWith showsPrec "NVClosureF" p c
292+
NVBuiltin' name _ -> showsUnaryWith showsPrec "NVBuiltinF" p name
293293

294294

295295
-- ** Traversable
@@ -436,7 +436,6 @@ mkNVSet' :: Applicative f
436436
=> PositionSet
437437
-> AttrSet r
438438
-> NValue' t f m r
439-
-- 2021-07-16: NOTE: that the arguments are flipped.
440439
mkNVSet' p s = NValue' $ pure $ NVSetF p s
441440

442441

@@ -554,7 +553,7 @@ liftNValue
554553
=> (forall x . u m x -> m x)
555554
-> NValue t f m
556555
-> NValue t f (u m)
557-
liftNValue run = hoistNValue run lift
556+
liftNValue = (`hoistNValue` lift)
558557

559558

560559
-- *** MonadTransUnlift

0 commit comments

Comments
 (0)