Advertisement
bergius

Infinite fibonacci sequence

May 4th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.17 KB | None | 0 0
  1. let fibs = seq {
  2.     let rec fibs (x: bigint) y = seq {
  3.         let z = y + x
  4.         yield z
  5.         yield! fibs y z
  6.     }
  7.  
  8.     yield! fibs (bigint 0) (bigint 1)
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement