Last active
December 10, 2015 14:41
-
-
Save oisdk/2f0d3454e22688adb0f8 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
func free<A,B>(f: A -> () -> B) -> A -> B { | |
return { f($0)() } | |
} | |
[[1, 2, 3], [4, 5, 6]].map(free(Array.reverse)) // [[3, 2, 1], [6, 5, 4]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment