Skip to content

Instantly share code, notes, and snippets.

@oisdk
Last active December 10, 2015 14:41
Show Gist options
  • Save oisdk/2f0d3454e22688adb0f8 to your computer and use it in GitHub Desktop.
Save oisdk/2f0d3454e22688adb0f8 to your computer and use it in GitHub Desktop.
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