lix/tests/functional/lang/eval-okay-foldlStrict-lazy-initial-accumulator.nix

7 lines
280 B
Nix
Raw Permalink Normal View History

# Checks that the nul value for the accumulator is not forced unconditionally.
# Some languages provide a foldl' that is strict in this argument, but Nix language does not.
builtins.foldl'
(_: x: x)
(throw "This is never forced")
[ "but the results of applying op are" 42 ]