title: Haskell - Compile Error
body: <pre><code>data Set a = Set [a]
  member xs x = elem x xs
  subset xs ys = and (map (member ys) xs)
  
  instance (Eq a) =&gt; Eq (Set a) where  
    (Set xs) == (Set ys) = (subset xs ys) &amp;&amp; (subset ys xs)
  
  class Ord a =&gt; Comparable a where
    cmp :: a -&gt; a -&gt; String
    cmp x y
      | x == y    = "eq"
      | otherwise = "neq"
  
  instance Comparable a =&gt; Comparable (Set a) where
    cmp (Set xs) (Set ys)
      | (Set xs) == (Set ys) = "same"
      | otherwise            = "different"  
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <p>Could not deduce (Ord (Set a))
    arising from the superclasses of an instance declaration
  from the context (Comparable a)
    bound by the instance declaration for ‘Comparable (Set a)’</p>
  
  <p>I'd like to know what the error is?
  Thanks.</p>