Skip to content

Instantly share code, notes, and snippets.

@gruggiero
Created August 13, 2020 12:30
Show Gist options
  • Save gruggiero/937d6c1df8568ea2130861bc425300cf to your computer and use it in GitHub Desktop.
Save gruggiero/937d6c1df8568ea2130861bc425300cf to your computer and use it in GitHub Desktop.
Simple Fibonacci with fs2
import fs2.{Stream, Pure}
def fib: Stream[Pure, Int] = Stream(0, 1) ++ fib.zipWith(fib.tail)(_ + _)
fib.take(10).toList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment