about summary refs log tree commit diff
path: root/tests/lang/eval-okay-flatten.nix
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-09-22T15·29+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-09-22T15·29+0000
commit2ab4bc44c780d2e28647f7559664675b756f38b9 (patch)
tree39ecb0e001cf6c031e15b0246559b3f8f7a06ed9 /tests/lang/eval-okay-flatten.nix
parentd315210612a8d5eb52654407903544b72222130b (diff)
* Builtin function `add' to add integers.
* Put common test functions in tests/lang/lib.nix.

Diffstat (limited to 'tests/lang/eval-okay-flatten.nix')
-rw-r--r--tests/lang/eval-okay-flatten.nix15
1 files changed, 2 insertions, 13 deletions
diff --git a/tests/lang/eval-okay-flatten.nix b/tests/lang/eval-okay-flatten.nix
index 2019263b8297..fe911e9683e2 100644
--- a/tests/lang/eval-okay-flatten.nix
+++ b/tests/lang/eval-okay-flatten.nix
@@ -1,17 +1,6 @@
-let {
-
-  fold = op: nul: list:
-    if list == []
-    then nul
-    else op (builtins.head list) (fold op nul (builtins.tail list));
+with import ./lib.nix;
 
-  concat =
-    fold (x: y: x + y) "";
-    
-  flatten = x:
-    if builtins.isList x
-    then fold (x: y: (flatten x) ++ y) [] x
-    else [x];
+let {
 
   l = ["1" "2" ["3" ["4"] ["5" "6"]] "7"];