diff options
author | Paul Phillips <paulp@improving.org> | 2010-11-29 23:00:07 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-11-29 23:00:07 +0000 |
commit | 66a92814a61c62149a49335f65f4189763b43296 (patch) | |
tree | 981508efdd7a29daa12f3e121d9608e441f26ece /tools/scalawhich | |
parent | 4ec7f11a799444c3758e94b3fdf9fa5c26330577 (diff) | |
download | scala-66a92814a61c62149a49335f65f4189763b43296.tar.gz scala-66a92814a61c62149a49335f65f4189763b43296.tar.bz2 scala-66a92814a61c62149a49335f65f4189763b43296.zip |
The initial implementation of TraversableOnce c...
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.
Diffstat (limited to 'tools/scalawhich')
0 files changed, 0 insertions, 0 deletions