* findFirst is used by the LaTeX function. Forgot to commit.

svn path=/nixpkgs/trunk/; revision=16438
wip/yesman
Eelco Dolstra 15 years ago
parent c6d7c043f7
commit 9f59fb9377
  1. 7
      pkgs/lib/lists.nix

@ -65,6 +65,13 @@ rec {
else head found;
# Find the first element in the list matching the specified
# predicate or returns `default' if no such element exists.
findFirst = pred: default: list:
let found = filter pred list;
in if found == [] then default else head found;
# Return true iff function `pred' returns true for at least element
# of `list'.
any = pred: list:

Loading…
Cancel
Save