<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">&lt;<a href="mailto:hvr@gnu.org" target="_blank">hvr@gnu.org</a>&gt;</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>
&gt;&gt; On Wed, Aug 22, 2012 at 07:49:49PM -0400, Edward Kmett wrote:<br>
&gt;&gt;&gt; We want to add<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; class Bits b where<br>
&gt;&gt;&gt;&gt;     bitSizeMaybe :: b -&gt; Maybe Int<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; and 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;&gt;<br>
&gt;&gt; I&#39;ve just pushed a patch implementing what I think the conclusion was.<br>
&gt;&gt; Please let me know if you think I got it wrong.<br>
&gt;<br>
&gt; My last comment was, that FiniteBits is not an appropriate name, and<br>
&gt; then we arrived at FixedBits:<br>
&gt;    <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&#39;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>