A simple example:
class A
class B
class C
object testobject {
val a = new A
implicit def b(a:A):B = new B
implicit def c(b:B) = new C
val b:B = a
val c:C = a
}
The last line doesn't compile. We have A=>B and B=>C implicit conversions defined but that doesn't infer A=>C.
It would be really nice to be able to have layers of implicit conversions work.
My particular problem. too long to post fully is actually from a web framework. I want to do something like:
A => Secure[A] => Format[A]
with the following
implicit def secure[A](a:A):Secure[A] = ???
implicit def format[A](sec:Secure[A]):Format[A] = ???
So I want to handle security and formatting through implicit magic, and only secured outputs can be formatted.
Has anybody found any tricks to make this, or something like this work?