Implicit list operations for Seq, Array, and Iterator that return the lists self type
<p>This is my container type.</p>

<pre><code>trait Container[Repr] { self: Repr =&gt;
  def doSomething(): Repr
}

case class IntContainer(value: Int) extends Container[IntContainer] {
  override def doSomething(): IntContainer = IntContainer(value + 1)
}

// IntContainer correctly returns self type
val res: IntContainer = IntContainer(10).doSomething()
</code></pre>

<p>These are my implicits for lists of the above container type.</p>

<pre><code>object Implicits {

  implicit class GenTraversableLikeMonadOps[C &lt;: Container[C], T](containers: GenTraversableLike[C, T]) {
    def doAllTheThings[That]()(implicit bf: CanBuildFrom[T, C, That]): That = 
      containers.map(_.doSomething())
  }

  implicit class ArrayMonadOps[C &lt;: Container[C]](containers: Array[C]) extends GenTraversableLikeMonadOps(containers)

}
</code></pre>

<hr>

<p><code>Seq</code>, <code>SeqView</code>, and <code>Array</code> all return the container self type and the list self type.</p>

<pre><code>import Implicits._
val seq: Seq[IntContainer] = Seq(IntContainer(0)).doAllTheThings()
val seqView: SeqView[IntContainer,_] = Seq(IntContainer(0)).view.doAllTheThings()
val array: Array[IntContainer] = Array(IntContainer(0)).doAllTheThings()
</code></pre>

<p>Iterator does not as it does not extend <code>GenTraversableLike</code></p>

<pre><code>import Implicits._
val iter: Iterator[IntContainer] = Seq(IntContainer(0)).iterator.doAllTheThings() // Cannot resolve symbol doAllTheThings
</code></pre>

<hr>

<p>Can I do this in a way such that <code>doAllTheThings()</code> returns the source list's self type without duplicating all of <code>GenTraversableLikeMonadOps</code> to handle the <code>Iterator</code> case?</p>