summaryrefslogtreecommitdiff
path: root/test/files/run/tuple-zipped.scala
Commit message (Collapse)AuthorAgeFilesLines
* Optimization of Predef implicits.Paul Phillips2012-04-301-2/+2
| | | | | | | All those wildcards in a default-scoped implicit are expensive, they each lead to a typevar on every search. Restructured the Tuple2/Tuple3 Zipped classes, they're better this way anyway. This also gets all that Tuple[23] code out of genprod.
* Revert "Moved ancillary methods off specialized traits."Paul Phillips2012-04-271-1/+1
| | | | | | This reverts commit 1d0372f84f9a7325a47beb55169cc454895ef74b. I forgot about polymorphic dispatch. Have to seek another way.
* Moved ancillary methods off specialized traits.Paul Phillips2012-04-241-1/+1
| | | | | | | Moved compose/andThen off Function1, curried/tupled off Function2. Pushed Tuple2 zipped into auxiliary class. Created implicits to plaster over the changes. This drops several hundred classfiles and takes (unoptimized) scala-library.jar from 7.8 Mb to 7.4 Mb.
* Begone t1737...Hubert Plociniczak2011-11-021-8/+8
|
* An overhaul of the collection-oriented methods ...Paul Phillips2010-10-111-0/+39
An overhaul of the collection-oriented methods in Tuple2/Tuple3 (which still need to be taken all the way to Tuple5.) * Zip semantics: zip and zipped now properly terminate when any collection runs out of elements, even if others are infinite. In addition, short circuiting methods (exists and forall) will terminate if the condition is met, even in the presence of infinity. Example: scala> val ys = Stream from 1 ys: scala.collection.immutable.Stream[Int] = Stream(1, ?) scala> (ys, ys).zipped forall ((x, y) => x+y < 100) res0: Boolean = false scala> (ys, ys).zipped exists ((x, y) => x+y > 100) res1: Boolean = true * There are implicits converting Zipped2/3 to Traversable to expose all the methods which aren't defined in an arity-specific way in the tuple classes. I have mixed feelings about putting these in Predef; but if there is another way to make them visible by default I wasn't able to find it. Example putting said implicit to use: scala> (ys, ys, ys).zipped find { case (x, y, z) => x+y+z > 1000 } res0: Option[(Int, Int, Int)] = Some((334,334,334)) Already reviewed by moors, so no review.