Skip to content

Instantly share code, notes, and snippets.

@keizo042
Last active August 29, 2015 13:57
Show Gist options
  • Save keizo042/9372564 to your computer and use it in GitHub Desktop.
Save keizo042/9372564 to your computer and use it in GitHub Desktop.
カリー化した関数。Haskellとscalaでは部分適用のニュアンスが異なる気がする。あとL10が通らないのが謎感高い。
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))
@keizo042
Copy link
Author

keizo042 commented Mar 5, 2014

L6: val boxWithX =box(1)( _:Int)( _:Int) でも動くには動くらしいからL10が動かないのが余計にわからない。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment