1 2 3 4 5 6 7 8 9
trait Rule[In] class C { def ruleWithName[In](f: In => Int): Rule[In] = { new DefaultRule(f) {} } class DefaultRule[In](f: In => Int) extends Rule[In] }