Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. trait Iface[B, C] {
  2. def meth(b: B): C
  3. }
  4.  
  5. def polish[B, C](f: (Iface[B, C], B) => C): (Iface[B, C], B) => C = { (a, b) =>
  6. f(a, b)
  7. }
  8.  
  9. object IfaceImpl extends Iface[String, String] {
  10. override def meth(b: String): String = b.reverse
  11. }
  12.  
  13. polish((a: Iface[String, String], b: String) => a meth b)(IfaceImpl, "hello")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement