<font face="arial, helvetica, sans-serif">To summarize the design we've converged upon during the discussion period for Ian:</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">We want to add </font></div>
<div><div><br style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)"><font face="courier new, monospace"><span style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">> class Bits b where</span><br style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">
<span style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">> bitSizeMaybe :: b -> Maybe Int</span><br style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">
</font></div></div><div><font face="arial, helvetica, sans-serif"><span style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)"><br></span></font></div><div><div><font face="arial, helvetica, sans-serif">and deprecate, but not remove </font><font face="courier new, monospace">bitSize</font><font face="arial, helvetica, sans-serif"> this iteration, and </font><span style="font-family:arial,helvetica,sans-serif">make a separate class FiniteBits for things with a finite, fixed number of bits:</span></div>
</div><div><div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><span style="background-color:rgb(255,255,255);color:rgb(80,0,80);font-size:12.800000190734863px"><font face="courier new, monospace">> class Bits b => FiniteBits b where</font></span></div>
<div><font face="courier new, monospace"><span style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">> finiteBitSize :: b -> Int</span><br style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">
<span style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">> finiteBitSize = bitSize</span></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">The former permits safer access to bitSize while allowing applications that can deal with infinite structures to run, the latter permits safer access to bitSize while allowing applications that cannot deal with infinite structures to know that they aren't dealing with Integer or somebody's Natural data type.<br style="color:rgb(80,0,80);font-size:12.800000190734863px;background-color:rgb(255,255,255)">
<br></font></div><div>-Edward</div><div><br></div><div><div class="gmail_quote">On Wed, Aug 22, 2012 at 5:19 PM, Ian Lynagh <span dir="ltr"><<a href="mailto:ian@well-typed.com" target="_blank">ian@well-typed.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Aug 13, 2012 at 06:42:54PM -0400, Edward Kmett wrote:<br>
><br>
> class Bits b where<br>
> perhapsBitSize :: b -> Maybe Int<br>
> ...<br>
><br>
</div><div class="im">> I am not wedded to the perhapsBitSize name<br>
<br>
</div>I've lost track of where this proposal is, but if we do end up with a<br>
Maybe function then I think it should be called maybeBitSize or<br>
bitSizeMaybe. The only analogous example in the core libraries that I<br>
can think of OTTOMH is Text.Read.readMaybe.<br>
<br>
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888">IAn<br>
</font></span><div class="HOEnZb"><div class="h5"><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></div></div>