summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/GenTraversableOnce.scala
diff options
context:
space:
mode:
authorJanek Bogucki <janekdb@gmail.com>2015-10-07 20:32:49 +0100
committerJanek Bogucki <janekdb@gmail.com>2015-10-09 20:07:19 +0100
commitb19a07ed15f8a633e0463e52839c956963a9c2f9 (patch)
tree43840caeaebc12e2c40d8620b1de579ad7529a83 /src/library/scala/collection/GenTraversableOnce.scala
parent648c7a1635f88fb14b999a8d36e01a71761b9001 (diff)
downloadscala-b19a07ed15f8a633e0463e52839c956963a9c2f9.tar.gz
scala-b19a07ed15f8a633e0463e52839c956963a9c2f9.tar.bz2
scala-b19a07ed15f8a633e0463e52839c956963a9c2f9.zip
Rename forall, exists and find predicate and operator params.
Align parameters names to use p for predicates and op for combining operations. Based on #4760. Extended to include, - Tuple2Zipped - Tuple3Zipped - Either The original author was vsalvis.
Diffstat (limited to 'src/library/scala/collection/GenTraversableOnce.scala')
-rw-r--r--src/library/scala/collection/GenTraversableOnce.scala23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/library/scala/collection/GenTraversableOnce.scala b/src/library/scala/collection/GenTraversableOnce.scala
index f77462ce88..a45ec965f5 100644
--- a/src/library/scala/collection/GenTraversableOnce.scala
+++ b/src/library/scala/collection/GenTraversableOnce.scala
@@ -393,20 +393,35 @@ trait GenTraversableOnce[+A] extends Any {
*/
def minBy[B](f: A => B)(implicit cmp: Ordering[B]): A
- def forall(pred: A => Boolean): Boolean
+ /** Tests whether a predicate holds for all elements of this $coll.
+ *
+ * $mayNotTerminateInf
+ *
+ * @param p the predicate used to test elements.
+ * @return `true` if this $coll is empty or the given predicate `p`
+ * holds for all elements of this $coll, otherwise `false`.
+ */
+ def forall(@deprecatedName('pred) p: A => Boolean): Boolean
- def exists(pred: A => Boolean): Boolean
+ /** Tests whether a predicate holds for at least one element of this $coll.
+ *
+ * $mayNotTerminateInf
+ *
+ * @param p the predicate used to test elements.
+ * @return `true` if the given predicate `p` is satisfied by at least one element of this $coll, otherwise `false`
+ */
+ def exists(@deprecatedName('pred) p: A => Boolean): Boolean
/** Finds the first element of the $coll satisfying a predicate, if any.
*
* $mayNotTerminateInf
* $orderDependent
*
- * @param pred the predicate used to test elements.
+ * @param p the predicate used to test elements.
* @return an option value containing the first element in the $coll
* that satisfies `p`, or `None` if none exists.
*/
- def find(pred: A => Boolean): Option[A]
+ def find(@deprecatedName('pred) p: A => Boolean): Option[A]
/** Copies values of this $coll to an array.
* Fills the given array `xs` with values of this $coll.