Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yuroyoro/580322 to your computer and use it in GitHub Desktop.
Save yuroyoro/580322 to your computer and use it in GitHub Desktop.
scala> implicit def d2s(d:Date) = {println("d2s"); d.toString}
d2s: (d: java.util.Date)java.lang.String
scala> def foo[T](d:T)(implicit f:(T =>String) ) = {println(f.toString);f(d) }
foo: [T](d: T)(implicit f: (T) => String)String
scala> foo( new Date)
<function1>
d2s
res2: String = Wed Sep 15 16:10:46 JST 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment