title: Why Scala library is so imperative?
body: <p>Looking at the Scala standart library I 've noticed that many of the functions(methods) are written in imperative style : loops are used more often than tailrec and so on. 
  For example:</p>
  
  <pre><code>@inline final override def takeWhile(p: A =&gt; Boolean): List[A] = {
      val b = new ListBuffer[A]
      var these = this
      while (!these.isEmpty &amp;&amp; p(these.head)) {
        b += these.head
        these = these.tail
      }
      b.toList
     }
  </code></pre>
  
  <p>Can be easily rewritten(as function):</p>
  
  <pre><code>def takeWhile[A](p:A=&gt;Boolean)(l:List[A]): List[A] ={
  @tailrec
  def takeWh(p:A=&gt;Boolean,l:List[A],r:List[A]):List[A]={
    if(l.isEmpty) r
    else if(p(l.head)) takeWh(p,l.tail,l.head::r)
    else r
  }
  takeWh(p,l,Nil).reverse
  }
  </code></pre>
  
  <p>Why Scala developers prefer imperative style over functional if Scala is supposed to be a functional language?</p>