Skip to content

Instantly share code, notes, and snippets.

@kcsongor
Created December 17, 2016 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kcsongor/ae2808dc1ce13d72e0c10f7162301539 to your computer and use it in GitHub Desktop.
Save kcsongor/ae2808dc1ce13d72e0c10f7162301539 to your computer and use it in GitHub Desktop.
fixonacci
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