From 14be783676adbb3517b2f73fee31c6f341575440 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Jul 2015 19:23:11 +0200 Subject: Add primops all and any These are used thousands of times during NixOS evaluation, so it's useful to speed them up. --- tests/lang/eval-okay-any-all.exp | 1 + tests/lang/eval-okay-any-all.nix | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/lang/eval-okay-any-all.exp create mode 100644 tests/lang/eval-okay-any-all.nix (limited to 'tests') diff --git a/tests/lang/eval-okay-any-all.exp b/tests/lang/eval-okay-any-all.exp new file mode 100644 index 000000000000..eb273f45b2a6 --- /dev/null +++ b/tests/lang/eval-okay-any-all.exp @@ -0,0 +1 @@ +[ false false true true true true false true ] diff --git a/tests/lang/eval-okay-any-all.nix b/tests/lang/eval-okay-any-all.nix new file mode 100644 index 000000000000..a3f26ea2aa83 --- /dev/null +++ b/tests/lang/eval-okay-any-all.nix @@ -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]) +] -- cgit 1.4.1