We could go with bitDefault popCountDefault, testBitDefault to mirror the fmapDefault and foldMapDefault in Data.Traversable, but I don&#39;t particularly care which color we paint this bikeshed.<div><br></div><div>-Edward<br>
<br><div class="gmail_quote">On Mon, Oct 17, 2011 at 1:29 PM, Bas van Dijk <span dir="ltr">&lt;<a href="mailto:v.dijk.bas@gmail.com">v.dijk.bas@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I agree.<br>
<br>
We should then also drop the default implementation of popCount.<br>
<br>
What about adding and exporting helper functions like Ian mentioned:<br>
<div class="im"><br>
numBit :: (Bits a, Num a) =&gt; Int -&gt; a<br>
</div>numBit i = 1 `shiftL` i<br>
{-# INLINE numBit #-}<br>
<br>
numPopCount :: (Bits a, Num a) =&gt; a -&gt; Int<br>
numPopCount = go 0<br>
<div class="im">  where<br>
    go !c 0 = c<br>
    go c w = go (c+1) (w .&amp;. w - 1)<br>
<br>
</div>numTestBit ::  (Bits a, Num a) =&gt; a -&gt; Int -&gt; Bool<br>
x `numTestBit` i = (x .&amp;. bit i) /= 0<br>
{-# INLINE numTestBit #-}<br>
<br>
Not sure about the names though?<br>
<div><div></div><div class="h5"><br>
On 17 October 2011 19:12, Edward Kmett &lt;<a href="mailto:ekmett@gmail.com">ekmett@gmail.com</a>&gt; wrote:<br>
&gt; I have to admit this seems to be the most sensible solution, and avoids<br>
&gt; stealing names that are more appropriate for numeric instances anyways.<br>
&gt; -Edward<br>
&gt;<br>
&gt; On Mon, Oct 17, 2011 at 3:26 AM, Joachim Breitner &lt;<a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; Am Samstag, den 15.10.2011, 17:41 -0700 schrieb John Meacham:<br>
&gt;&gt; &gt; I would just remove the bit and testBit defalut instances, they seem<br>
&gt;&gt; &gt; like reasonable primitives to be required for an instance.<br>
&gt;&gt;<br>
&gt;&gt; I agree. Bits is certainly not something that a Haskell Beginner would<br>
&gt;&gt; have to implement every day, but is more likely a task that requires<br>
&gt;&gt; lots of thought and well-written code anyway. Having to implement these<br>
&gt;&gt; two functions as well is not a large burden there.<br>
&gt;&gt;<br>
&gt;&gt; Greetings,<br>
&gt;&gt; Joachim<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Joachim &quot;nomeata&quot; Breitner<br>
&gt;&gt;  <a href="mailto:mail@joachim-breitner.de">mail@joachim-breitner.de</a>  |  <a href="mailto:nomeata@debian.org">nomeata@debian.org</a>  |  GPG: 0x4743206C<br>
&gt;&gt;  xmpp: <a href="mailto:nomeata@joachim-breitner.de">nomeata@joachim-breitner.de</a> | <a href="http://www.joachim-breitner.de/" target="_blank">http://www.joachim-breitner.de/</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Libraries mailing list<br>
&gt;&gt; <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Libraries mailing list<br>
&gt; <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>