Skip to content

Instantly share code, notes, and snippets.

@justinhj
Created July 14, 2019 04: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 justinhj/82f1fe89f0e2332ce8a697d2b2126ba2 to your computer and use it in GitHub Desktop.
Save justinhj/82f1fe89f0e2332ce8a697d2b2126ba2 to your computer and use it in GitHub Desktop.
@ val fb = Stream.emits(List("", "", "fizz")).repeat.zip(Stream.emits(List("", "", "", "", "buzz")).repeat).map{case (a,b) => a |+| b}
fb: Stream[Nothing, String] = Stream(..)
@ fb.take(30).toList
res37: List[String] = List(
"",
"",
"fizz",
"",
"buzz",
"fizz",
"",
"",
"fizz",
"buzz",
"",
"fizz",
"",
"",
"fizzbuzz",
"",
"",
"fizz",
"",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment