Created
January 20, 2014 10:42
-
-
Save cohalz/8518102 to your computer and use it in GitHub Desktop.
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 rec repeat f n x = | |
if n > 0 then repeat f (n -1) (f x) else x | |
let fib n = | |
let (fibn, _) = repeat (fun (p, c) -> (c, c+p)) n (0, 1) in | |
fibn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment