title: Scala: using foldl to add pairs from list to a map?
body: <p>I am trying to add pairs from list to a map using foldl. I get the following error:</p>
  
  <pre><code>"missing arguments for method /: in trait TraversableOnce; follow this method with `_' if you want to treat it as a partially applied function"
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>      val pairs = List(("a", 1), ("a", 2), ("c", 3), ("d", 4))
  
    def lstToMap(lst:List[(String,Int)], map: Map[String, Int] ) = {
      (map /: lst) addToMap ( _, _)
    }
  
    def addToMap(pair: (String, Int), map: Map[String, Int]): Map[String, Int] = {
        map + (pair._1 -&gt; pair._2)
    }
  </code></pre>
  
  <p>What is wrong?</p>