summaryrefslogtreecommitdiff
path: root/test/files/pos/iterator-traversable-mix.scala
Commit message (Collapse)AuthorAgeFilesLines
* The initial implementation of TraversableOnce c...Paul Phillips2010-11-291-0/+8
The initial implementation of TraversableOnce could not supply concrete methods or even signatures for map and flatMap because they have different signatures in Iterator and TraversableLike. But we can take another approach which works out as nicely: 1) Create implicits which install those methods and flatten on TraversableOnce instances. 2) Generalize the signatures of flatten and flatMap to work with A => TraversableOnce[B] instead of A => Traversable[B]. And voila, you can mix and match Iterators and Traversables in a for comprehension, map, flatMap, and flatten, without the tedious process of sprinkling .iterator or .toList around to appease the compiler. No review.