Every datatype that supports the operations filterWith, map, and flatMap (with the proper types) can be used in sequence comprehensions.
If you want to change selection, open document below and click on "Move attachment"
Sequence Comprehensions - Scala Documentation , j);
foo(20, 32) foreach {
case (i, j) =>
println("(" + i + ", " + j + ")")
}
}
This example shows that comprehensions are not restricted to lists. The previous program uses iterators instead. <span>Every datatype that supports the operations filterWith, map, and flatMap (with the proper types) can be used in sequence comprehensions.
Here’s the output of the program:
(13, 19)
(14, 18)
(15, 17)
(16, 16)
There is also a special form of sequence comprehension which returns Unit. Here the bindings that are created fro
Summary
status
not read
reprioritisations
last reprioritisation on
suggested re-reading day
started reading on
finished reading on
Details
Discussion
Do you want to join discussion? Click here to log in or create user.