Skip to content

Instantly share code, notes, and snippets.

@hirokiky
Created April 7, 2013 14:50
Show Gist options
  • Save hirokiky/5330787 to your computer and use it in GitHub Desktop.
Save hirokiky/5330787 to your computer and use it in GitHub Desktop.
Getting fibonacci series using block-chain (https://github.com/podhmo/block-chain)
from block.chain import chain, MaybeF
def fib(ctx, x):
x.append(x[-2] + x[-1])
return x
print chain.chain.do(fib).do(fib).do(fib).do(fib).value(MaybeF(), [1, 1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment