Skip to content

Commit 4025133

Browse files
committed
Normal: stubCycles: use foldl'
`reverse` walks the whole list & strictifies the process, the `foldl'` should be used here.
1 parent 1d3a9c2 commit 4025133

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Nix/Normal.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import Nix.Thunk
2323
import Nix.Value
2424

2525
newtype NormalLoop t f m = NormalLoop (NValue t f m)
26-
deriving Show
26+
deriving Show
2727

2828
instance MonadDataErrorContext t f m => Exception (NormalLoop t f m)
2929

@@ -158,10 +158,10 @@ stubCycles =
158158
(\_ t ->
159159
Free $
160160
NValue' $
161-
foldr
162-
(addProvenance1 @m @(NValue t f m))
161+
foldl'
162+
(flip $ addProvenance1 @m @(NValue t f m))
163163
cyc
164-
(reverse $ citations @m @(NValue t f m) t)
164+
(citations @m @(NValue t f m) t)
165165
)
166166
Free
167167
where

0 commit comments

Comments
 (0)