A good technique that some libraries provide by default is to bind implications to a trait. In this way, you can create many implications by defining a trait that extends other implicit linking traits. And then you can use it at the top of your scala file with the following.
import MyBundleOfImplicits._
Or to be more selective, mixing it only where you need it.
object Main extends App with MyBundleOfImplicits {
Unfortunately, something like JavaConversions, in order to use this method, you will need to override all the implications that you want to use inside the attribute.
trait JavaConversionsImplicits { import java.{lang => jl} import java.{util => ju} import scala.collection.JavaConversions implicit def asJavaIterable[A](i : Iterable[A]): jl.Iterable[A] = JavaConversions.asJavaIterable(i) implicit def asJavaIterator[A](i : Iterator[A]): ju.Iterator[A] = JavaConversions.asJavaIterator(i) } trait MyBundleOfImplicits extends JavaConversionsImplicits with OtherImplicits
source share