-
-
Save kciesielski/36d0e31b1d57772367e5 to your computer and use it in GitHub Desktop.
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
def logged[K, T](f: (K) => T)(arg: K): T = { | |
// log arg | |
f(arg) | |
// log arg | |
} | |
def someFunction(value: Integer): Integer = { | |
Integer.valueOf(value * 2) | |
} | |
def theExecution() { | |
// here we go: the 'execution' object has exactly the same type as 'someFunction' | |
val execution = logged(someFunction) _ | |
execution(2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment