title: Finding character in 2 dimensional scala list
body: <p>So this might not be the best way to tackle it but my initial thought was a for expression. 
  Say I have a List like</p>
  
  <pre><code>List(List('a','b','c'),List('d','e','f'),List('h','i','j'))
  </code></pre>
  
  <p>I would like to find the row and column for a character, say <code>'e'</code>. </p>
  
  <pre><code>def findChar(letter: Char, list: List[List[Char]]): (Int, Int) =
    for {
      r &lt;- (0 until list.length)
      c &lt;- (0 until list(r).length)
      if list(r)(c) == letter
    } yield (r, c)
  </code></pre>
  
  <p>If there is a more elegant way I'm all ears but I would also like to understand what's wrong with this. Specifically the error the compiler gives me here is </p>
  
  <pre><code>type mismatch;  found   : scala.collection.immutable.IndexedSeq[(Int, Int)]  required: (Int, Int)
  </code></pre>
  
  <p>on the line assigning to <code>r</code>. It seems to be complaining that my iterator doesn't match the return type but I don't quite understand why this is or what to do about it ...</p>