Skip to content

Commit 6bf57f5

Browse files
committed
Add a few more examples
1 parent 5e31fb3 commit 6bf57f5

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

input/src/main/scala/fix/Collectionstrawman_v0.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,16 @@ object Collectionstrawman_v0_Range {
5151
(1 to 10).map(_ + 2)
5252
(0 until 10).map(_ + 3)
5353
}
54+
55+
object Collectionstrawman_v0_Traversable {
56+
def foo(xs: Traversable[(Int, String)], ys: List[Int]): Unit = {
57+
xs.toList
58+
xs.toSet
59+
ys.toSeq
60+
xs.to[List]
61+
xs.to[Set]
62+
xs.toMap
63+
xs.toIterator
64+
ys.iterator
65+
}
66+
}

output/src/main/scala/fix/Collectionstrawman_v0.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package fix
33
import strawman.collection.{ arrayToArrayOps, stringToStringOps }
44
import strawman.collection.immutable.{ #::, ::, HashMap, LazyList, List, Map, Nil, Range, Vector }
55
import strawman.collection.mutable.ArrayBuffer
6+
67
object Collectionstrawman_v0_List {
78
List(1, 2, 3)
89
1 :: 2 :: 3 :: Nil
@@ -49,3 +50,16 @@ object Collectionstrawman_v0_Range {
4950
Range.inclusive(1, 10).map(_ + 2)
5051
Range(0, 10).map(_ + 3)
5152
}
53+
54+
object Collectionstrawman_v0_Traversable {
55+
def foo(xs: Iterable[(Int, String)], ys: List[Int]): Unit = {
56+
xs.to(List)
57+
xs.to(Set)
58+
ys.toSeq
59+
xs.to(List)
60+
xs.to(strawman.collection.immutable.Set)
61+
xs.to(strawman.collection.Map)
62+
xs.iterator()
63+
ys.iterator()
64+
}
65+
}

0 commit comments

Comments
 (0)