title: Where is the Set type class?
body: <p>In Haskell <a href="http://hackage.haskell.org/package/containers/docs/Data-Set.html" rel="nofollow noreferrer"><code>Data.Set</code></a> implements a concrete set type. Normal <code>[]</code> lists also implement all operations of a set (in <a href="https://hackage.haskell.org/package/base/docs/Data-List.html" rel="nofollow noreferrer"><code>Data.List</code></a>). But there seems to be no predefined <code>Set</code> typeclass that they both implement. You can implement one yourself:</p>
  
  <pre><code>{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FunctionalDependencies #-}
  
  module Set where
  
  import qualified Data.List as ConcreteList
  import qualified Data.Set as ConcreteSet
  
  class Set set a | set -&gt; a where
    empty :: set
    singleton :: a -&gt; set
    insert :: a -&gt; set -&gt; set
    delete :: a -&gt; set -&gt; set
    union :: set -&gt; set -&gt; set
    intersection :: set -&gt; set -&gt; set
    member :: a -&gt; set -&gt; Bool
    filter :: (a -&gt; Bool) -&gt; set -&gt; set
  
  instance (Ord a) =&gt; Set (ConcreteSet.Set a) a where
    empty = ConcreteSet.empty
    singleton = ConcreteSet.singleton
    insert = ConcreteSet.insert
    delete = ConcreteSet.delete
    union = ConcreteSet.union
    intersection = ConcreteSet.intersection
    member = ConcreteSet.member
    filter = ConcreteSet.filter
  
  instance (Eq a) =&gt; Set [a] a where
    empty = []
    singleton e = [e]
    insert = (:)
    delete = ConcreteList.delete
    union = ConcreteList.union
    intersection = ConcreteList.intersect
    member = ConcreteList.elem
    filter = ConcreteList.filter
  </code></pre>
  
  <p>but it seems that this would already have been done if this was the way to go. So my question is: Where is the <code>Set</code> typeclass or what alternative solution has the Haskell community come up with?</p>
  
  <p>My question is admittedly quite similar to <a href="https://stackoverflow.com/questions/25191659/why-is-haskell-missing-obvious-typeclasses">Why is Haskell missing “obvious” Typeclasses</a>, but by being more concrete (focusing on a specific example with sample implementation), I'm hoping to get some more concrete answers as well.</p>