How to fix this type mismatch?
<p>Suppose I am defining <code>zipWith</code> like this:</p>

<pre><code>def zipWith[A](f:(A, A) =&gt; A)(xs:Iterable[A], ys:Iterable[A]): Iterable[A] =
  (xs, ys).zipped map f
</code></pre>

<p>Now I'd like to use for zipping matrices like that:</p>

<pre><code>type Matrix = Vector[Vector[Int]]

val zipMatrix: ((Int, Int) =&gt; Int) =&gt; Matrix =&gt; Matrix =&gt; Matrix = f =&gt;
  zipWith(zipWith(f)) 
</code></pre>

<p>However I got an error:</p>

<pre><code>&lt;console&gt;:15: error: type mismatch;
found   : (Iterable[Iterable[Int]], Iterable[Iterable[Int]]) =&gt; Iterable[Iterable[Int]]
required: Matrix =&gt; (Matrix =&gt; Matrix)
(which expands to)  scala.collection.immutable.Vector[Vector[Int]] =&gt; (scala.collection.immutable.Vector[Vector[Int]] =&gt; scala.collection.immutable.Vector[Vector[Int]])
</code></pre>

<p>Why doesn't <code>Vector[Vector[Int]]</code> match <code>Iterable[Iterable[Int]]</code> ? How to fix this error ?</p>