Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Iface[B, C] {
- def meth(b: B): C
- }
- def polish[B, C](f: (Iface[B, C], B) => C): (Iface[B, C], B) => C = { (a, b) =>
- f(a, b)
- }
- object IfaceImpl extends Iface[String, String] {
- override def meth(b: String): String = b.reverse
- }
- polish((a: Iface[String, String], b: String) => a meth b)(IfaceImpl, "hello")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement