title: Haskell error: "No instance fo (Eq Time) arising from a use of '=='
body: <p>I'm pretty new to Haskell and I don't get why I can't compare those 2 variables.
  I have this function:</p>
  
  <pre><code>nextMinute :: Date -&gt; Time -&gt; DateTime
  nextMinute date time = if time == Time 23 59
                         then DateTime (tomorrow date) newDay
                         else DateTime date (timeSucc time)
  </code></pre>
  
  <p>I get this error message:</p>
  
  <pre><code>Time.hs:88:32:
      No instance for (Eq Time) arising from a use of ‘==’
      In the expression: time == Time 23 59
      In the expression:
        if time == Time 23 59 then
            DateTime date newDay
        else
            DateTime date (timeSucc time)
      In an equation for ‘nextMinute’:
          nextMinute date time
            = if time == Time 23 59 then
                  DateTime date newDay
              else
                  DateTime date (timeSucc time)
  </code></pre>