Created
August 13, 2020 12:30
-
-
Save gruggiero/937d6c1df8568ea2130861bc425300cf to your computer and use it in GitHub Desktop.
Simple Fibonacci with fs2
This file contains 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
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