title: Why Int Does Not Implement 'Monoid'?
body: <p>Given a <code>Maybe Int</code>, I tried to <code>mappend</code> it to itself.</p>
  
  <pre><code>$let x = Just 55 :: Maybe Int
  
  $mappend x x
  
  &lt;interactive&gt;:126:1:
      No instance for (Monoid Int) arising from a use of `mappend'
      In the expression: mappend x x
      In an equation for `it': it = mappend x x
  </code></pre>
  
  <p>Looking at <a href="https://hackage.haskell.org/package/base-4.2.0.1/docs/Data-Maybe.html">Maybe</a>, I see:</p>
  
  <blockquote>
    <p>Monoid a => Monoid (Maybe a)</p>
  </blockquote>
  
  <p>Since <a href="https://hackage.haskell.org/package/base-4.8.0.0/docs/Data-Int.html">Int</a> does not implement <code>Monoid</code> type-class, that explains why I can't use <code>mappend</code> with <code>Maybe Int</code>.</p>
  
  <p>But, I remembered from <a href="http://learnyouahaskell.com/functors-applicative-functors-and-monoids">LYAH</a> that I can use <code>Sum</code>:</p>
  
  <pre><code>ghci&gt; let x = Sum 55
  ghci&gt; mappend x x
  Sum {getSum = 110}
  </code></pre>
  
  <p>But, why isn't <code>Int</code> a Monoid?</p>