Skip to content

Instantly share code, notes, and snippets.

@einblicker
Created April 2, 2012 23:51
Show Gist options
  • Save einblicker/2288107 to your computer and use it in GitHub Desktop.
Save einblicker/2288107 to your computer and use it in GitHub Desktop.
再帰型があるとhungry functionが書ける
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