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

svn path=/nixpkgs/trunk/; revision=16438
This commit is contained in:
Eelco Dolstra 2009-07-22 14:43:39 +00:00
parent c6d7c043f7
commit 9f59fb9377

View File

@ -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: