title: Difference in use between predefined typeclasses and basic types
body: <p>I am reading through some of the examples in LYAH and I came across this snippet of code:</p>
  
  <pre><code>replicate' :: (Num i, Ord i) =&gt; i -&gt; a -&gt; [a]  
  replicate' n x  
    | n &lt;= 0    = []  
    | otherwise = x:replicate' (n-1) x  
  </code></pre>
  
  <p>This is from the online version, but I also have a copy of the book which has this instead:</p>
  
  <pre><code>replicate' :: Int -&gt; a -&gt; [a]  
  replicate' n x  
    | n &lt;= 0    = []  
    | otherwise = x:replicate' (n-1) x  
  </code></pre>
  
  <p>I have tried both of these out and they both work but my question is:</p>
  
  <p>Are these implementations different and when should I use the typeclasses instead of the regular types?</p>