Type class recursive resolution

In our previous example, we haven't implemented the connection functionality for the parameterized UsbC type, and our solution was only limited to UsbC[String].

We could improve our solution by further delegating the connection logic. Say that we have an implicit function, T => Boolean, available—we could say that this is the logic the user of our library wants to use to describe the connection method. 

This is an example of a bad use of implicits. This does not only include primitive Boolean types; it is highly probable that it will refer to another predefined type at the moment the implicit conversion will be defined. We provide this example exactly as it is mentioned—as an illustration of the bad design ...

Get Learn Scala Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.