Skip to content

Commit 2ad5a13

Browse files
committed
Value: iterNValue': flip 1st arg, fixpoint implementation
1 parent 95812c8 commit 2ad5a13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Nix/Value.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ lmapNValueF f = \case
327327
iterNValue'
328328
:: forall t f m a r
329329
. MonadDataContext f m
330-
=> (a -> (NValue' t f m a -> r) -> r)
330+
=> ((NValue' t f m a -> r) -> a -> r)
331331
-> (NValue' t f m r -> r)
332332
-> NValue' t f m a
333333
-> r
334-
iterNValue' k f = f . fmap (\a -> k a (iterNValue' k f))
334+
iterNValue' k f = fix ((f .) . fmap . k)
335335

336336
-- *** Utils
337337

0 commit comments

Comments
 (0)