Skip to content

Commit 29cf22b

Browse files
committed
Add Range, Array and String examples
1 parent 51edbb4 commit 29cf22b

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,14 @@ object Collectionstrawman_v0_ArrayBuffer {
3939
import scala.collection.mutable.ArrayBuffer
4040
val xs: ArrayBuffer[Int] = ArrayBuffer(1, 2, 3)
4141
}
42+
43+
object Collectionstrawman_v0_ArrayAndString {
44+
def foo(xs: Array[Int], ys: String): Unit = {
45+
xs.map(x => x + 1)
46+
ys.map(c => c.toUpper)
47+
}
48+
}
49+
50+
object Collectionstrawman_v0_Range {
51+
for (i <- 1 to 10; j <- 0 until 10) yield (i, j)
52+
}

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package fix
22

33
import scala.{ List => _, Nil => _, Seq => _, Vector => _, :: => _, #:: => _ }
4-
import scala.Predef.{ Map => _ }
5-
import strawman.collection.immutable.{ LazyList, List, Map, Nil, Seq, Vector, :: }
4+
import scala.Predef.{ Map => _, augmentString => _, intArrayOps => _ }
5+
import strawman.collection.{ stringToStringOps, arrayToArrayOps }
6+
import strawman.collection.immutable.{ LazyList, List, Map, Nil, Range, Seq, Vector, :: }
67
import strawman.collection.immutable.LazyList.#::
78

89
object Collectionstrawman_v0_List {
@@ -41,3 +42,14 @@ object Collectionstrawman_v0_ArrayBuffer {
4142
import strawman.collection.mutable.ArrayBuffer
4243
val xs: ArrayBuffer[Int] = ArrayBuffer(1, 2, 3)
4344
}
45+
46+
object Collectionstrawman_v0_ArrayAndString {
47+
def foo(xs: Array[Int], ys: String): Unit = {
48+
xs.map(x => x + 1)
49+
ys.map(c => c.toUpper)
50+
}
51+
}
52+
53+
object Collectionstrawman_v0_Range {
54+
for (i <- Range.inclusive(1, 10); j <- Range(0, 10)) yield (i, j)
55+
}

0 commit comments

Comments
 (0)