Last active
January 3, 2016 09:39
-
-
Save dyokomizo/8443850 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
| module Fix where | |
| left :: a -> (a -> c) -> (b -> c) -> c | |
| left a l r = l a | |
| right :: b -> (a -> c) -> (b -> c) -> c | |
| right b l r = r b | |
| fix f a = f a (fix f) id |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-- ghci output
Fix> fix (\x -> if x > 0 then left (x - 1) else right True) 10
True