Skip to content

Commit 51edbb4

Browse files
committed
Add a few examples
1 parent 7083321 commit 51edbb4

File tree

2 files changed

+73
-4
lines changed

2 files changed

+73
-4
lines changed

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,39 @@ rewrite = "scala:fix.Collectionstrawman_v0"
33
*/
44
package fix
55

6-
object Collectionstrawman_v0_Test {
6+
object Collectionstrawman_v0_List {
77
List(1, 2, 3)
8+
1 :: 2 :: 3 :: Nil
9+
val isEmpty: List[_] => Boolean = {
10+
case Nil => true
11+
case x :: xs => false
12+
}
13+
}
14+
15+
object Collectionstrawman_v0_Stream {
16+
Stream(1, 2, 3)
17+
1 #:: 2 #:: 3 #:: Stream.Empty
18+
val isEmpty: Stream[_] => Boolean = {
19+
case Stream.Empty => true
20+
case x #:: xs => false
21+
}
22+
}
23+
24+
object Collectionstrawman_v0_Vector {
25+
val xs: Vector[Int] = Vector(1, 2, 3)
26+
}
27+
28+
object Collectionstrawman_v0_Seq {
29+
val xs: Seq[Int] = Seq(1, 2, 3)
30+
}
31+
32+
object Collectionstrawman_v0_Map {
33+
val xs: Map[Int, String] = Map(1 -> "1", 2 -> "2", 3 -> "3")
34+
import scala.collection.immutable.HashMap
35+
val ys = HashMap.empty
36+
}
37+
38+
object Collectionstrawman_v0_ArrayBuffer {
39+
import scala.collection.mutable.ArrayBuffer
40+
val xs: ArrayBuffer[Int] = ArrayBuffer(1, 2, 3)
841
}
Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,43 @@
11
package fix
22

3-
import scala.{ List => _ }
4-
import strawman.collection.immutable.List
5-
object Collectionstrawman_v0_Test {
3+
import scala.{ List => _, Nil => _, Seq => _, Vector => _, :: => _, #:: => _ }
4+
import scala.Predef.{ Map => _ }
5+
import strawman.collection.immutable.{ LazyList, List, Map, Nil, Seq, Vector, :: }
6+
import strawman.collection.immutable.LazyList.#::
7+
8+
object Collectionstrawman_v0_List {
69
List(1, 2, 3)
10+
1 :: 2 :: 3 :: Nil
11+
val isEmpty: List[_] => Boolean = {
12+
case Nil => true
13+
case x :: xs => false
14+
}
15+
}
16+
17+
object Collectionstrawman_v0_Stream {
18+
LazyList(1, 2, 3)
19+
1 #:: 2 #:: 3 #:: LazyList.Empty
20+
val isEmpty: Stream[_] => Boolean = {
21+
case Stream.Empty => true
22+
case x #:: xs => false
23+
}
24+
}
25+
26+
object Collectionstrawman_v0_Vector {
27+
val xs: Vector[Int] = Vector(1, 2, 3)
28+
}
29+
30+
object Collectionstrawman_v0_Seq {
31+
val xs: Seq[Int] = Seq(1, 2, 3)
32+
}
33+
34+
object Collectionstrawman_v0_Map {
35+
val xs: Map[Int, String] = Map(1 -> "1", 2 -> "2", 3 -> "3")
36+
import strawman.collection.immutable.HashMap
37+
val ys = HashMap.empty
38+
}
39+
40+
object Collectionstrawman_v0_ArrayBuffer {
41+
import strawman.collection.mutable.ArrayBuffer
42+
val xs: ArrayBuffer[Int] = ArrayBuffer(1, 2, 3)
743
}

0 commit comments

Comments
 (0)