Created
March 18, 2015 12:59
-
-
Save shigemk2/90d6092764e8be9b86be 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
val add10 = (n:Int) => n + 10 | |
val mult2 = (n:Int) => n * 2 | |
val addxy = (x:Int,y:Int) => x + y | |
println(add10.andThen(mult2)(1)) | |
println(add10.compose(mult2)(1)) | |
// println(addxy.andThen(mult2)(1)(2)) | |
// println(mult2.compose(addxy)(1)(2)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment