Created
December 17, 2016 02:43
-
-
Save kcsongor/ae2808dc1ce13d72e0c10f7162301539 to your computer and use it in GitHub Desktop.
fixonacci
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
fix f = let x = f x in x | |
fib = fix (\f -> 0 : 1 : zw (+) f (tail f)) | |
where | |
zw = fix (\zw' -> \f xs ys -> case xs of | |
(x : xs') -> case ys of | |
(y : ys') -> f x y : zw' f xs' ys' | |
_ -> [] | |
_ -> []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment