mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-12 23:27:50 +03:00
Use builtin all and any functions
This commit is contained in:
parent
a2f16fdcff
commit
447afef153
@ -90,12 +90,12 @@ rec {
|
|||||||
|
|
||||||
# Return true iff function `pred' returns true for at least element
|
# Return true iff function `pred' returns true for at least element
|
||||||
# of `list'.
|
# of `list'.
|
||||||
any = pred: fold (x: y: if pred x then true else y) false;
|
any = builtins.any or (pred: fold (x: y: if pred x then true else y) false);
|
||||||
|
|
||||||
|
|
||||||
# Return true iff function `pred' returns true for all elements of
|
# Return true iff function `pred' returns true for all elements of
|
||||||
# `list'.
|
# `list'.
|
||||||
all = pred: fold (x: y: if pred x then y else false) true;
|
all = builtins.all or (pred: fold (x: y: if pred x then y else false) true);
|
||||||
|
|
||||||
|
|
||||||
# Count how many times function `pred' returns true for the elements
|
# Count how many times function `pred' returns true for the elements
|
||||||
|
Loading…
Reference in New Issue
Block a user