tvix/eval: foldl'
maybe isn't strict, actually
#209
Opened by sterni at
nix-repl> let x = builtins.foldl' (x: y: x ++ [ y ]) [ ] [ 1 2 (throw "lol") 3 ]; in builtins.head x 1
It seems to me that the “strict” in primop_foldlStrict
is an exaggeration, as it doesn't actually force the arguments before calling the function if I read the code correctly.
C++ Nix's
foldl'
isn't strict in any way atm, I opened a PR to make it behave as Haskell's strict fold does: https://github.com/NixOS/nix/pull/7158.sterni at 2022-10-11T12·28+00
-
sterni at 2022-10-11T12·48+00
- sterni closed this issue at 2022-10-11T15·54+00