diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-05-14 17:00:41 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-05-14 17:00:41 +0000 |
commit | 0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9 (patch) | |
tree | e138fc41bd53014e534308450e8aa59dc50c1d43 /src/library | |
parent | 76b511c18b7c45417e2b2e65cf53bb50c7d7d420 (diff) | |
download | scala-0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9.tar.gz scala-0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9.tar.bz2 scala-0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9.zip |
Documented flatten, see #909
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/List.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/library/scala/List.scala b/src/library/scala/List.scala index 84560f2939..2bb49e652e 100644 --- a/src/library/scala/List.scala +++ b/src/library/scala/List.scala @@ -1272,6 +1272,14 @@ sealed abstract class List[+A] extends Seq[A] { def - [B >: A](x: B): List[B] = this -- List(x) + /** Concatenate the elements of this list. The elements of this list + * should be a <code>Iterables</code>. + * + * Note: The compiler might not be able to infer the type parameter. + * + * @param f An implicit conversion to an <code>Iterable</code> instance. + * @return The concatenation of all elements of iterables in this list. + */ def flatten[B](implicit f : A => Iterable[B]) : List[B] = { val buf = new ListBuffer[B] foreach(f(_).foreach(buf += _)) |