title: Don't know how to use toEnum in Haskell
body: <p>Am pretty new in haskell. I have the following code piece: </p>
  
  <pre><code>data Weekdays = Mon | Tue | Wed | Thu | Fri | Sat | Sun
                  deriving (Eq, Enum, Show)
  
  weekday :: Date -&gt; Weekdays
  weekday date = toEnum (mod (cntDays date) 7)
  </code></pre>
  
  <p>I get the following error message:</p>
  
  <pre><code>Time.hs:8:29:
      Couldn't match expected type ‘Int’ with actual type ‘Integer’
      In the first argument of ‘mod’, namely ‘(cntDays date)’
      In the first argument of ‘toEnum’, namely ‘(mod (cntDays date) 7)’
  Failed, modules loaded: none.
  </code></pre>
  
  <p>cntDays gives back an Integer. So how am I able to get back 'Sun' for example as a return Value wenn cntDays gives back a '6'?</p>