Skip to content

Instantly share code, notes, and snippets.

@sshark
Created April 22, 2019 13:58
Show Gist options
  • Select an option

  • Save sshark/333e390a8bf7a860eeb012c7790ba2cc to your computer and use it in GitHub Desktop.

Select an option

Save sshark/333e390a8bf7a860eeb012c7790ba2cc to your computer and use it in GitHub Desktop.
Fibonacci sequence using FS2
import fs2._
val fibs:Stream[Pure, Int] = Stream(0) ++ fibs.scan(1)(_ + _)
fibs.take(10).compile.toList.foreach(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment