Created
April 2, 2012 23:51
-
-
Save einblicker/2288107 to your computer and use it in GitHub Desktop.
再帰型があるとhungry functionが書ける
This file contains hidden or 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
class Hungry(f: Int => Hungry) { | |
def apply(n: Int) = f(n) | |
} | |
val f: Hungry = new Hungry(_ => f) | |
f(0) | |
f(0)(1)(2) | |
f(0)(1)(2)(3)(4)(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment