text: Q:
  
  How to convert Map[String,Seq[String]] to Map[String,String]
  
  I have a Map[String,Seq[String]] and want to basically covert it to a Map[String,String] since I know the sequence will only have one value.
  
  A:
  
  Someone else already mentioned mapValues, but if I were you I would do it like this:
  scala> val m = Map(1 -> Seq(1), 2 -> Seq(2))
  m: scala.collection.immutable.Map[Int,Seq[Int]] = Map(1 -> List(1), 2 -> List(2))
  
  scala> m.map { case (k,Seq(v)) => (k,v) }
  res0: scala.collection.immutable.Map[Int,Int] = Map(1 -> 1, 2 -> 2)
  
  Two reasons:
  
  The mapValues method produces a view of the result Map, meaning that the function will be recomputed every time you access an element.  Unless you plan on accessing each element exactly once, or you only plan on accessing a very small percentage of them, you don't want that recomputation to take place.
  Using a case with (k,Seq(v)) ensures that an exception will be thrown if the function ever sees a Seq that doesn't contain exactly one element.  Using _(0) or _.head will throw an exception if there are zero elements, but will not complain if you had more than one, which will likely result in mysterious bugs later on when things go missing without errors.
  
  A:
  
  You can use mapValues().
  scala> Map("a" -> Seq("aaa"), "b" -> Seq("bbb"))
  res0: scala.collection.immutable.Map[java.lang.String,Seq[java.lang.String]] = M
  ap(a -> List(aaa), b -> List(bbb))
  
  scala> res0.mapValues(_(0))
  res1: scala.collection.immutable.Map[java.lang.String,java.lang.String] = Map(a
  -> aaa, b -> bbb)
  
  