Created
July 11, 2012 14:21
-
-
Save gkojax/3090675 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 addUmm: String => String = _ + " umm" | |
val addAhem: String => String = _ + " ahem" | |
val ummThenAhem = addAhem.compose(addUmm) | |
def addUmm2(x: String) = x + " umm" | |
def addAhem2(x: String) = x + " ahem" | |
val ummThenAhem2 = (addAhem2 _).compose(addUmm2 _) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment