<div dir="ltr">I believe the resolution was to explicitly leave bitSizeMaybe _not_ implemented in terms of bitSize to help ensure it gets filled in correctly.<div><br></div><div>Im rather neutral on whether we should supply a definition in the other direction.</div>
<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 18, 2013 at 7:56 AM, Herbert Valerio Riedel <span dir="ltr"><<a href="mailto:hvr@gnu.org" target="_blank">hvr@gnu.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2012-09-24 at 01:28:20 +0200, Henning Thielemann wrote:<br>
>> On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote:<br>
>>> We want to add<br>
>>><br>
>>>> class Bits b where<br>
>>>> bitSizeMaybe :: b -> Maybe Int<br>
>>><br>
>>> and 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>
>> I've just pushed a patch implementing what I think the conclusion was.<br>
>> Please let me know if you think I got it wrong.<br>
><br>
> My last comment was, that FiniteBits is not an appropriate name, and<br>
> then we arrived at FixedBits:<br>
> <a href="http://www.haskell.org/pipermail/libraries/2012-August/018349.html" target="_blank">http://www.haskell.org/pipermail/libraries/2012-August/018349.html</a><br>
<br>
As it stands, the current implementation state is at<br>
<br>
<a href="http://git.haskell.org/packages/base.git/commitdiff/cddc9024e67a6d4c01bb190839d0134af8c907e0" target="_blank">http://git.haskell.org/packages/base.git/commitdiff/cddc9024e67a6d4c01bb190839d0134af8c907e0</a><br>
<br>
Now I have two questions:<br>
<br>
1.) Currently, bitSizeMaybe and bitSize have no default implementation<br>
defined. Shall we define mutually recursive default implementations<br>
for these two functions to help smooth the transition?<br>
<br>
e.g. in the style (just an example, not an actual proposal) of:<br>
<br>
bitSize = fromJust . bitSizeMaybe<br>
<br>
bitSizeMaybe = Just . bitSize<br>
<br>
<br>
2.) As it's probably not to late to easily fix any bikeshedding/naming<br>
issues: Shall the naming remain as implemented?<br>
<br>
Cheers,<br>
hvr<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>
</blockquote></div><br></div>