summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2008-05-14 17:00:41 +0000
committerIulian Dragos <jaguarul@gmail.com>2008-05-14 17:00:41 +0000
commit0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9 (patch)
treee138fc41bd53014e534308450e8aa59dc50c1d43 /src
parent76b511c18b7c45417e2b2e65cf53bb50c7d7d420 (diff)
downloadscala-0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9.tar.gz
scala-0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9.tar.bz2
scala-0702dce858a732d1c1ac1214c5c5fed0c7dc9ae9.zip
Documented flatten, see #909
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/List.scala8
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 += _))