Last active
August 29, 2015 14:04
-
-
Save PatrickMcDonald/5cac28af02813d5c0d93 to your computer and use it in GitHub Desktop.
Generate Fibonacci numbers
This file contains hidden or 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
let fibs() = | |
let rec fibs' a b = | |
seq { | |
yield b | |
yield! fibs' b (a+b) | |
} | |
fibs' 1L 1L | |
fibs() |> Seq.take 10 |> List.ofSeq;; | |
fibs() |> Seq.takeWhile (fun x -> x < 10000000000L) |> List.ofSeq;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment