title: Mapping a function over two input lists
body: <p>I have a function that I want to test with several sets of inputs. Let's say the function is</p>
  
  <pre><code>f :: a -&gt; b -&gt; c
  </code></pre>
  
  <p>Now I have two lists of inputs:</p>
  
  <pre><code>inputA :: [a]
  inputB :: [[b]]
  </code></pre>
  
  <p>For <code>inputA !! i</code>, I want evaluate <code>f $ input !! i</code> for each element of the list at <code>inputB !! i</code>. I know I need several applications of <code>map</code> to do this, but I am having difficulty wrapping my head around a solution.</p>
  
  <p>My most recent attempt is</p>
  
  <pre><code>map f inputA &lt;$&gt; inputB
  </code></pre>
  
  <p>which gives the following error:</p>
  
  <blockquote>
    <p>Couldn't match expected type <code>a0 -&gt; b0' with actual type</code>[b1]'<br>
        In the return type of a call of <code>map'<br>
        Probable cause:</code>map' is applied to too many arguments<br>
        In the first argument of <code>(&lt;$&gt;)', namely</code>map f inputA'<br>
        In the expression: map f inputA  inputB</p>
  </blockquote>
  
  <p>How should I go about solving this problem? I don't necessarily want a complete solution. A push (or even a shove) in a helpful direction would definitely be appreciated.</p>
  
  <p><strong>Additional thoughts:</strong></p>
  
  <pre><code>map f inputA :: [b -&gt; c]
  </code></pre>
  
  <p>I think this is the right direction. Now I need to map each of the functions over each list of inputs in <code>inputB</code>.</p>
  
  <p>To clarify, I want to map the <code>i</code>th function in <code>map f inputA</code> over the <code>i</code>th list of inputs in <code>inputB</code> to get a result <code>outputC :: [[c]]</code>.</p>