Skip to content

Commit 3b5c31c

Browse files
authored
Improved description of ++ on Traversable.scala
1 parent b81f080 commit 3b5c31c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/scala/stdlib/Traversables.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ object Traversables extends FlatSpec with Matchers with org.scalaexercises.defin
2424
*
2525
* The `foreach` method is meant to traverse all elements of the collection, and apply the given operation, `f`, to each element. The type of the operation is `Elem => U`, where `Elem` is the type of the collection's elements and `U` is an arbitrary result type. The invocation of `f` is done for its side effect only; in fact any function result of `f` is discarded by `foreach`.
2626
*
27-
* Traversables are the superclass of `List`, `Array`, `Map`, `Set`, `Stream` and more. The methods involved can be applied to each other in a different type. `++` appends two `Traversable`s together.
27+
* Traversables are the superclass of `List`, `Array`, `Map`, `Set`, `Stream` and more. The methods involved can be applied to each other in a different type.
28+
`++` appends two `Traversable`s together. The resulting `Traversable` is the same type of the first element.
2829
*/
2930
def topOfCollectionTraversables(res0: Int, res1: Int) {
3031
val set = Set(1, 9, 10, 22)

0 commit comments

Comments
 (0)