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"><<a href="mailto:haskell@benmachine.co.uk" target="_blank">haskell@benmachine.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Wouldn'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't be fixed?<br>
<br>
(although if we'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>
<<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>> wrote:<br>
><br>
> On Sun, 26 Aug 2012, Ian Lynagh wrote:<br>
><br>
>> On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote:<br>
>>><br>
>>><br>
>>> deprecate, but not remove bitSize this iteration, and make a separate<br>
>>> class FiniteBits for things with a finite, fixed number of bits:<br>
>>><br>
>>>> class Bits b => FiniteBits b where<br>
>>>> finiteBitSize :: b -> Int<br>
>>>> finiteBitSize = bitSize<br>
><br>
><br>
><br>
> Bit size is always finite in strict data types, isn't it? I suggest a name<br>
> containing "Fixed".<br>
><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>
<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>