diff options
author | Griffin Smith <root@gws.fyi> | 2022-10-09T16·59-0400 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2022-10-10T15·26+0000 |
commit | ba8ec1910bf2527eb290c128a04c23f42ec6a3bb (patch) | |
tree | 9dc58e5037ffe74ae041907ef2e92a6e7d44c0ab /tvix/eval/src/tests/tvix_tests/eval-okay-foldl.nix | |
parent | 0e97555644f54bf6991b5d44ff297b6343dbc7e0 (diff) |
feat(tvix/eval): Implement builtins.foldl' r/5076
Change-Id: Ibc97db4343cb3a1a1677f69fb6c3518c61978aad Reviewed-on: https://cl.tvl.fyi/c/depot/+/6906 Autosubmit: grfn <grfn@gws.fyi> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-foldl.nix')
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-foldl.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-foldl.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-foldl.nix new file mode 100644 index 000000000000..44c0349387ff --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-foldl.nix @@ -0,0 +1,5 @@ +[ + (builtins.foldl' builtins.add 0 [1 2 3]) + (builtins.foldl' (l1: l2: l1 ++ l2) [0] [[1] [2 3]]) + (builtins.foldl' (x: y: if x == 0 then y else x * y) 0 [1 2]) +] |