<div dir="ltr">In my tests, using unordered-containers was slightly slower than using Ord, although as the number of repeated elements grows unordered-containers appears to have an advantage.  I&#39;m sure the relative costs of comparison vs hashing would affect this also.  But both are dramatically better than the current nub.<div>
<br></div><div>Has anyone looked at Bart&#39;s patches to see how difficult it would be to apply them (or re-write them)?<br><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 15, 2013 at 8:43 PM, Clark Gaebel <span dir="ltr">&lt;<a href="mailto:cgaebel@uwaterloo.ca" target="_blank">cgaebel@uwaterloo.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Apologies. I was being lazy. Here&#39;s a stable version:<br>
<div class="im"><br>
  import qualified Data.HashSet as S<br>
<br>
</div>  hashNub :: (Ord a) =&gt; [a] -&gt; [a]<br>
  hashNub l = go S.empty l<br>
    where<br>
      go _ []     = []<br>
      go s (x:xs) = if x `S.member` s then go s xs<br>
                                    else x : go (S.insert x s) xs<br>
<br>
Which, again, will probably be faster than the one using Ord, and I<br>
can&#39;t think of any cases where I&#39;d want the one using Ord instead. I<br>
may just not be creative enough, though.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
  - Clark<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Mon, Jul 15, 2013 at 12:46 AM, Brandon Allbery &lt;<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>&gt; wrote:<br>
&gt; On Sun, Jul 14, 2013 at 7:54 AM, Clark Gaebel &lt;<a href="mailto:cgaebel@uwaterloo.ca">cgaebel@uwaterloo.ca</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Oops sorry I guess my point wasn&#39;t clear.<br>
&gt;&gt;<br>
&gt;&gt; Why ord based when hashable is faster? Then there&#39;s no reason this has to<br>
&gt;&gt; be in base, it can just be a<br>
&gt;<br>
&gt; Did the point about &quot;stable&quot; fly overhead?<br>
&gt;<br>
&gt; --<br>
&gt; brandon s allbery kf8nh                               sine nomine associates<br>
&gt; <a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net">ballbery@sinenomine.net</a><br>
&gt; unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a><br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div></div></div></div>