summary refs log tree commit diff
path: root/lib/lists.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-12 13:50:45 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-12 13:50:45 +0100
commita8b693fef7bd44695a3891deb386a4d09ae8ae1b (patch)
treefce66b811cafe81ede9b31d05a233598e6073196 /lib/lists.nix
parent785eaf2cea3c57daef96bb209f44589e3f48a7ff (diff)
downloadnixpkgs-a8b693fef7bd44695a3891deb386a4d09ae8ae1b.tar
nixpkgs-a8b693fef7bd44695a3891deb386a4d09ae8ae1b.tar.gz
nixpkgs-a8b693fef7bd44695a3891deb386a4d09ae8ae1b.tar.bz2
nixpkgs-a8b693fef7bd44695a3891deb386a4d09ae8ae1b.tar.lz
nixpkgs-a8b693fef7bd44695a3891deb386a4d09ae8ae1b.tar.xz
nixpkgs-a8b693fef7bd44695a3891deb386a4d09ae8ae1b.tar.zst
nixpkgs-a8b693fef7bd44695a3891deb386a4d09ae8ae1b.zip
Remove backward-compatible implementations of some primops
Nixpkgs requires at least Nix 1.2 anyway, so these are now useless.
Diffstat (limited to 'lib/lists.nix')
-rw-r--r--lib/lists.nix20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/lists.nix b/lib/lists.nix
index 2a1fa720563..d6e8628f03a 100644
--- a/lib/lists.nix
+++ b/lib/lists.nix
@@ -10,7 +10,7 @@ let
 
 in rec {
 
-  inherit (builtins) head tail length isList elemAt;
+  inherit (builtins) head tail length isList elemAt concatLists filter elem;
 
 
   # Create a list consisting of a single element.  `singleton x' is
@@ -58,10 +58,6 @@ in rec {
     in imap' 0;
 
 
-  # Concatenate a list of lists.
-  concatLists = builtins.concatLists or (fold (x: y: x ++ y) []);
-
-
   # Map and concatenate the result.
   concatMap = f: list: concatLists (map f list);
 
@@ -75,24 +71,10 @@ in rec {
     else [x];
 
 
-  # Filter a list using a predicate; that is, return a list containing
-  # every element from `list' for which `pred' returns true.
-  filter =
-    builtins.filter or
-    (pred: list:
-      fold (x: y: if pred x then [x] ++ y else y) [] list);
-
-
   # Remove elements equal to 'e' from a list.  Useful for buildInputs.
   remove = e: filter (x: x != e);
 
 
-  # Return true if `list' has an element `x'.
-  elem =
-    builtins.elem or
-    (x: list: fold (a: bs: x == a || bs) false list);
-
-
   # Find the sole element in the list matching the specified
   # predicate, returns `default' if no such element exists, or
   # `multiple' if there are multiple matching elements.