The problem is that right now bitSize is deliberately excluded from looking at its argument to determine the number of bits in it. You _really_ want a different combinator. Almost every user of bitSize is passing it undefined, not a real value.<div>
<br></div><div><br><div class="gmail_quote">On Tue, Aug 28, 2012 at 12:07 PM, Ben Millwood <span dir="ltr">&lt;<a href="mailto:haskell@benmachine.co.uk" target="_blank">haskell@benmachine.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Wouldn&#39;t it be possible to have an instance Bits ByteString, or Vector<br>
Bool or something, where the bitsize would depend on the bytestring<br>
length, and hence wouldn&#39;t be fixed?<br>
<br>
(although if we&#39;re catering for that sort of use, the docs will need<br>
to be changed)<br>
<div class="HOEnZb"><div class="h5"><br>
On Sun, Aug 26, 2012 at 9:53 PM, Henning Thielemann<br>
&lt;<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>&gt; wrote:<br>
&gt;<br>
&gt; On Sun, 26 Aug 2012, Ian Lynagh wrote:<br>
&gt;<br>
&gt;&gt; On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; deprecate, but not remove bitSize this iteration, and make a separate<br>
&gt;&gt;&gt; class FiniteBits for things with a finite, fixed number of bits:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; class Bits b =&gt; FiniteBits b where<br>
&gt;&gt;&gt;&gt;    finiteBitSize :: b -&gt; Int<br>
&gt;&gt;&gt;&gt;    finiteBitSize = bitSize<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Bit size is always finite in strict data types, isn&#39;t it? I suggest a name<br>
&gt; containing &quot;Fixed&quot;.<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>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>