Skip to content

Instantly share code, notes, and snippets.

@choplin
Last active August 29, 2015 14:16
Show Gist options
  • Save choplin/fadc00537f65cee85216 to your computer and use it in GitHub Desktop.
Save choplin/fadc00537f65cee85216 to your computer and use it in GitHub Desktop.
scala> case class Foo(i:Int)
defined class Foo
scala> Foo.isInstanceOf[Int => Foo]
res4: Boolean = true
scala> Seq(1,2,3).map(Foo)
res5: Seq[Foo] = List(Foo(1), Foo(2), Foo(3))
scala> def foo(f: Int => Foo)(i:Int) = f(i)
foo: (f: Int => Foo)(i: Int)Foo
scala> foo(Foo)(1)
res9: Foo = Foo(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment