Created
January 12, 2012 01:15
-
-
Save acfoltzer/1597856 to your computer and use it in GitHub Desktop.
Fix at work
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 :: (a -> a) -> a | |
fix f = f (fix f) | |
fact' :: (Integer -> Integer) -> Integer -> Integer | |
fact' = \bang -> \n -> if n == 0 then 1 else n * bang (n-1) | |
fact :: Integer -> Integer | |
fact = fix fact' | |
onehundredandtwenty :: Integer | |
onehundredandtwenty = fact 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment