Created
February 25, 2015 01:27
-
-
Save caiiiycuk/92503185ee9d4ec7512c to your computer and use it in GitHub Desktop.
Iterators fun
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val x = Iterator.from(0).takeWhile(_ <= 10) | |
val y = Iterator.from(0).takeWhile(_ <= 10) | |
val xy = y.flatMap { y => x.map { x => (x, y) } } | |
xy.foreach(println) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment