Skip to content

Instantly share code, notes, and snippets.

@caiiiycuk
Created February 25, 2015 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caiiiycuk/92503185ee9d4ec7512c to your computer and use it in GitHub Desktop.
Save caiiiycuk/92503185ee9d4ec7512c to your computer and use it in GitHub Desktop.
Iterators fun
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