Skip to content

Instantly share code, notes, and snippets.

@tsuharesu
Created March 23, 2015 22:21
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 tsuharesu/cde33918293575e01331 to your computer and use it in GitHub Desktop.
Save tsuharesu/cde33918293575e01331 to your computer and use it in GitHub Desktop.
Fibonacci via Stream
# Generate a stream
Stream.unfold({0, 1}, fn {a, b} -> {a, {b, a + b}} end)
# Take the first 15 numbers
|> Enum.take(15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment