title: Deriving inferred type of composed functions Haskell: Specifically (.) map uncurry
body: <p>There are a lot of threads on here about deriving inferred type of composed functions but I am still fairly confused. None of the posts I found give a general explanation on how to unify types.</p>
  
  <p>I have a problem on one of my study guides for an exam and I'm having trouble figuring it out.</p>
  
  <p>8) What is the inferred type of (.) map  uncurry :: <strong>________</strong></p>
  
  <p>I am able to derive the inferred type most of the time but I am still sort of confused. For example, I know that to get the answer for (.) map  uncurry you need to first derived the type of map  uncurry. This I am able to do</p>
  
  <p>Given the following types</p>
  
  <pre><code>map  :: (a -&gt; b) -&gt; [a] -&gt; [b]
  uncurry :: (a -&gt; b -&gt; c) -&gt; (a, b) -&gt; c 
  </code></pre>
  
  <p>I unify the function (a -> b)  in map with uncurry so </p>
  
  <pre><code>a = a → b → c
  b = (a, b) → c
  </code></pre>
  
  <p>And then the answer is the other half of map [a] -> [b] with the new values of a and b so </p>
  
  <pre><code>map uncurry :: [ a -&gt; b -&gt; c ] -&gt; [ (a, b) -&gt; c]
  </code></pre>
  
  <p>Then you need to unify </p>
  
  <pre><code>(.)  :: (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
  map uncurry :: [ a -&gt; b -&gt; c ] -&gt; [ (a, b) -&gt; c]
  </code></pre>
  
  <p>The answer is supposed to be </p>
  
  <pre><code>(.) map uncurry :: (a -&gt; b1 -&gt; b) -&gt; [(a, b1)] -&gt; [b]
  </code></pre>
  
  <p>but I don't understand where b1 comes from or basically how its done. 
  I think what I really need is an explanation of type unification in general. What is the method to unify two types and how do I know if two types <strong>cannot</strong> be unified. </p>
  
  <p>If anyone could give a step by step explanation of how to derive (.) map uncurry I would greatly appreciate it.</p>