title: why Data.Set has no powerset function?
body: <p>I was looking at <code>Data.Set</code>, and I found out that it has no <code>powerset</code> function. Why?</p>
  
  <p>I can implement it like this:</p>
  
  <pre><code>import Data.Set (Set, empty, fromList, toList, insert)
  
  powerset :: (Ord a) =&gt; Set a -&gt; Set (Set a)
  powerset s = fromList $ map (fromList) (powerList $ toList s)
  
  powerList :: [a] -&gt; [[a]]
  powerList [] = [[]]
  powerList (x:xs) = powerList xs ++ map (x:) (powerList xs)
  </code></pre>
  
  <p>But this doesn't seem the most efficient way of doing it. OK, I can also write</p>
  
  <pre><code>powerList :: [a] -&gt; [[a]]
  powerList = filterM (const [True, False])
  </code></pre>
  
  <p>but still, I wonder why <code>Data.Set</code> has no <code>powerset</code> function.</p>
  
  <p>Also, what is the best way to write <code>powerset :: (Ord a) =&gt; Set a -&gt; Set (Set a)</code>?</p>