title: Haskell data type Counts for State Monad
body: <p>How can I use the following data type for a Monoid instance of it?</p>
  
  <pre><code>data Counts = Counts {
      binds   :: Int,
      returns :: Int,
      gets    :: Int,
      puts    :: Int
  } deriving (Eq, Show)
  </code></pre>
  
  <p>E.g. I figured something like:</p>
  
  <pre><code>mempty  = Counts { 0, 0, 0, 0 }
  (Counts { b, r, g, p }) mappend (Counts { b', r', g', p' })  = Counts { (b + b'), (r + r'), (g + g'), (p + p') }
  </code></pre>
  
  <p>But that gives me a parse error on '0'... Maybe I'm doing it totally wrong and misunderstanding the data type / monoid, but I cannot figure it out. If anyone could help me out it'd be much appreciated!</p>
  
  <p>Best regards,
  Skyfe.</p>