mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Add primops all and any
These are used thousands of times during NixOS evaluation, so it's useful to speed them up.
This commit is contained in:
parent
39e27a04b8
commit
14be783676
4 changed files with 67 additions and 0 deletions
1
tests/lang/eval-okay-any-all.exp
Normal file
1
tests/lang/eval-okay-any-all.exp
Normal file
|
@ -0,0 +1 @@
|
|||
[ false false true true true true false true ]
|
11
tests/lang/eval-okay-any-all.nix
Normal file
11
tests/lang/eval-okay-any-all.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
with builtins;
|
||||
|
||||
[ (any (x: x == 1) [])
|
||||
(any (x: x == 1) [2 3 4])
|
||||
(any (x: x == 1) [1 2 3 4])
|
||||
(any (x: x == 1) [4 3 2 1])
|
||||
(all (x: x == 1) [])
|
||||
(all (x: x == 1) [1])
|
||||
(all (x: x == 1) [1 2 3])
|
||||
(all (x: x == 1) [1 1 1])
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue