Skip to content

Instantly share code, notes, and snippets.

@hakobe
Created July 14, 2009 12:35
Show Gist options
  • Select an option

  • Save hakobe/146923 to your computer and use it in GitHub Desktop.

Select an option

Save hakobe/146923 to your computer and use it in GitHub Desktop.
class Applyer[-A, +B]( f :(A => B)) {
def apply(x:A) :B = {
this.f(x)
}
}
val a = new Applyer[String, int]( {x :AnyRef => x.hashCode} )
println(
a.apply("hello")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment