diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2008-11-27 17:03:59 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2008-11-27 17:03:59 +0000 |
commit | f7638a5cbb4e9a8aa63355ba05452298ecb896fe (patch) | |
tree | 4153180a9e5cdf0349521bf70e41594727420a52 /src/library | |
parent | f3bf480dc36ed94e9fb69107ce1534578df42b31 (diff) | |
download | scala-f7638a5cbb4e9a8aa63355ba05452298ecb896fe.tar.gz scala-f7638a5cbb4e9a8aa63355ba05452298ecb896fe.tar.bz2 scala-f7638a5cbb4e9a8aa63355ba05452298ecb896fe.zip |
Added example for List.flatten (see #909).
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/List.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library/scala/List.scala b/src/library/scala/List.scala index 660f1b5691..48d986f0e8 100644 --- a/src/library/scala/List.scala +++ b/src/library/scala/List.scala @@ -1289,7 +1289,13 @@ sealed abstract class List[+A] extends Seq[A] with Product { /** 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. + * Note: The compiler might not be able to infer the type parameter, + * so it is recommended to provide an explicit type argument. + * + * Example: + * <code>List(List(1, 3), List(2)).flatten[Int]</code> + * returns + * <code>List(1, 3, 2)</code> * * @param f An implicit conversion to an <code>Iterable</code> instance. * @return The concatenation of all elements of iterables in this list. |