Rename Stream<T> to Sequence<T> and provide migration path via deprecated types and functions.

This commit is contained in:
Ilya Ryzhenkov
2015-03-10 18:10:57 +03:00
parent 9684d217b3
commit e448f40756
47 changed files with 1906 additions and 556 deletions
@@ -11,7 +11,7 @@ class IteratorsJVMTest {
fun intToBinaryDigits() = { (i: Int) ->
val binary = Integer.toBinaryString(i)!!
var index = 0
stream<Char> { if (index < binary.length()) binary.get(index++) else null }
sequence<Char> { if (index < binary.length()) binary.get(index++) else null }
}
val expected = arrayListOf(
@@ -27,7 +27,7 @@ class IteratorsJVMTest {
}
test fun flatMapOnIterator() {
val result = streamOf(1, 2).flatMap { i -> (0..i).stream()}
val result = sequenceOf(1, 2).flatMap { i -> (0..i).sequence()}
assertEquals(listOf(0, 1, 0, 1, 2), result.toList())
}
}