title: What instance of CanBuildFrom does the Scala compiler find out?
body: <p>everyone . Please forgive me asking a stupid question on Scala. 
  Though I have been  programming in Scala for about 2 years, I still find it hard to understand <code>implicit</code> usage. Let's take an example for discussion: </p>
  
  <pre><code>Array(1,2,3,4).map(x =&gt; x) 
  </code></pre>
  
  <p>If you look up the scaladoc, you cant' find the method <code>map</code> on <code>Array</code> class. The reason that <code>map</code> can apply on <code>Array(1,2,3,4)</code> is  that there is an implicit function <code>implicit def intArrayOps (xs: Array[Int]): ArrayOps[Int]</code> defined in <code>scala.Predef</code>.</p>
  
  <p>However, there are two parameter lists, where the second one is written as <code>implicit bf: CanBuildFrom[Array[T], B, That])</code>. Now I wonder where the compiler finds a proper argument for type <code>CanBuildFrom</code> when applying <code>map</code> on <code>Array(1,2,3,4)</code>.  </p>