Last active
August 29, 2015 13:57
-
-
Save keizo042/9372564 to your computer and use it in GitHub Desktop.
カリー化した関数。Haskellとscalaでは部分適用のニュアンスが異なる気がする。あとL10が通らないのが謎感高い。
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 box(x:Int)(y: Int)(z:Int)= | |
x * y * z | |
println(box(1)(2)(3)) | |
val boxWithX = box(1)_ | |
println(boxWithX(2)(2)) | |
val boxWithXY =boxWithX(2)(_:Int) | |
// val boxWithXY =boxWithX(2)_ | |
println(boxWithXY(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
L6: val boxWithX =box(1)( _:Int)( _:Int) でも動くには動くらしいからL10が動かないのが余計にわからない。