Skip to content

Commit db7ca45

Browse files
committed
Eval: add question why insert into const
1 parent 2ba1061 commit db7ca45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Nix/Eval.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,16 +484,17 @@ buildArgument
484484
buildArgument params arg =
485485
do
486486
scope <- currentScopes :: m (Scopes m v)
487+
let argThunk = defer $ withScopes scope arg
487488
case params of
488-
Param name -> M.singleton name <$> defer (withScopes scope arg)
489+
Param name -> M.singleton name <$> argThunk
489490
ParamSet s isVariadic m ->
490491
do
491492
(args, _) <- fromValue @(AttrSet v, AttrSet SourcePos) =<< arg
492493
let
493494
inject =
494495
maybe
495496
id
496-
(\ n -> M.insert n $ const $ defer $ withScopes scope arg)
497+
(\ n -> M.insert n $ const argThunk) -- why insert into const?
497498
m
498499
loebM
499500
(inject $

0 commit comments

Comments
 (0)