title: Haskell type class confusion
body: <p>I'm beginning to learn Haskell and, while it's generally been great, some particularities of the type class system have led to a lot of frustration during numerically-focused projects. As a concrete example, if I open up ghci and check the type of addition, I get:</p>
  
  <pre><code>Prelude&gt; :t (+)
  (+) :: Num a =&gt; a -&gt; a -&gt; a
  </code></pre>
  
  <p>Addition is super-generic, <code>Num</code> is the most generic type class, etc, so everything makes sense. But if I declare some function to be addition, and then check the type of <em>that</em> function, the type class gets reduced to <code>Integer</code>!</p>
  
  <pre><code>Prelude&gt; let add = (+)
  Prelude&gt; :t add
  add :: Integer -&gt; Integer -&gt; Integer
  </code></pre>
  
  <p>So... what's going on?</p>