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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.