Created
October 22, 2014 01:03
-
-
Save kongtomorrow/9d4eb16b02bc8993a162 to your computer and use it in GitHub Desktop.
processing a func with arbitrary parameters
This file contains 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 logWrap<Domain,Range>(f : Domain->Range) -> Domain->Range { | |
return { (args:Domain) -> Range in | |
println("called me!") | |
return f(args) | |
} | |
} | |
func foo(a:Int, b:Int)->Int { | |
return a + b | |
} | |
println(logWrap(foo)(3,4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment