Created
June 23, 2016 19:29
-
-
Save sleexyz/a904af56e49758d6fa315ca8e1978400 to your computer and use it in GitHub Desktop.
Fixed point combinator derived without knot-tying, via recursive types
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
newtype Self t = Fold { unfold :: Self t -> t} | |
fix :: (a -> a) -> a | |
fix f = unroll . Fold $ f . unroll | |
unroll :: Self t -> t | |
unroll e = unfold e e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment