title: What is happening when I compose * with + in Haskell?
body: <p>I'm trying to understand the result of </p>
  
  <pre><code>(*) . (+) 
  </code></pre>
  
  <p>in Haskell. I know that the composition operator is just the standard composition of mathematical functions- so </p>
  
  <pre><code>(f . g) = f (g x)
  </code></pre>
  
  <p>But:</p>
  
  <pre><code>(*) . (+) :: (Num (a -&gt; a), Num a) =&gt; a -&gt; (a -&gt; a) -&gt; a -&gt; a
  </code></pre>
  
  <p>I'm struggling to understand this type signature. I would have expected to be able to do things like:</p>
  
  <pre><code>((*) . (+)) 1 2 :: Num a =&gt; a -&gt; a
  = (* (+ 1 2))
  </code></pre>
  
  <p>What is the meaning of (*) . (+)'s type signature? I tried playing with it by something like (just matching up with its signature):</p>
  
  <pre><code>((*) . (+)) 1 (\x -&gt; x + 1) 1
  </code></pre>
  
  <p>But that fails to compile. I'm trying to walk through the logical steps when composing these, but I'm not fully understanding how it's getting to this result (and what the result <em>is</em>).</p>