Pro tip: implicits REPL, reify reflect - .
scala> import reflect.runtime.universe.reify
scala> import collection.mutable._ // To clean up reified exprs
scala> reify(a.view.map(_ + 1).map(_ * 2))
Expr[Seq[Int]](Predef.intArrayOps($read.a).view.map(((x$1) => x$1.$plus(1)))(IndexedSeqView.arrCanBuildFrom).map(((x$2) => x$2.$times(2)))(Seq.canBuildFrom))
IndexedSeqView.arrCanBuildFrom IndexedSeqView, SeqView. , SeqView . , CBF, map, SeqView.canBuildFrom, - Seq. , , SeqView.canBuildFrom .
scala> a.view.map(_ + 1).map(_ * 2)(collection.SeqView.canBuildFrom)
<console>:??: error: polymorphic expression cannot be instantiated to expected type;
found : [A]scala.collection.generic.CanBuildFrom[collection.SeqView.Coll,A,scala.collection.SeqView[A,Seq[_]]]
(which expands to) [A]scala.collection.generic.CanBuildFrom[scala.collection.TraversableView[_, _ <: Traversable[_]],A,scala.collection.SeqView[A,Seq[_]]]
required: scala.collection.generic.CanBuildFrom[scala.collection.SeqView[Int,Array[Int]],Int,?]
a.view.map(_ + 1).map(_ * 2)(collection.SeqView.canBuildFrom)
^
, - ; , .
scalac , CBF be Int , , , A, . , , . .
scala> implicitly[collection.SeqView[Int, _] <:< collection.TraversableView[_, _]]
<function1>
Array[Int] <: Traversable[_]. . Array Traversable, Seq CBF Seq.
, SeqView arrCanBuildFrom IndexedSeqView. . Array; , Array ( Traversable) .