Skip to content

Commit fab166d

Browse files
committed
Reduce: reduce: reduce <$>
1 parent ea6e8c5 commit fab166d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Nix/Reduce.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,9 @@ reduce (NWith_ ann scope body) =
247247
-- constants and strings to the body scope.
248248
reduce (NLet_ ann binds body) =
249249
do
250-
s <-
251-
M.fromList . catMaybes <$>
250+
binds' <- traverse sequence binds
251+
body' <-
252+
(`pushScope` body) . M.fromList . catMaybes =<<
252253
traverse
253254
(\case
254255
NamedVar (StaticKey name :| []) def _pos ->
@@ -264,10 +265,10 @@ reduce (NLet_ ann binds body) =
264265

265266
_ -> pure Nothing
266267

268+
267269
)
268270
binds
269-
body' <- pushScope s body
270-
binds' <- traverse sequence binds
271+
271272
-- let names = gatherNames body'
272273
-- binds' <- traverse sequence binds <&> \b -> flip filter b $ \case
273274
-- NamedVar (StaticKey name _ :| mempty) _ ->

0 commit comments

Comments
 (0)