<br><br><div class="gmail_quote">On Sun, Jul 29, 2012 at 12:38 PM, Antoine Latter <span dir="ltr">&lt;<a href="mailto:aslatter@gmail.com" target="_blank">aslatter@gmail.com</a>&gt;</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 Sun, Jul 29, 2012 at 11:37 AM, Antoine Latter &lt;<a href="mailto:aslatter@gmail.com">aslatter@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; The downside to this proposal is that the requester (Edward) actually<br>
&gt; wants a function of type &quot;a -&gt; Maybe Int&quot;, so his polymorphic function<br>
&gt; can handle both infinite bit-types and finite bit-types.<br>
&gt;<br>
&gt; With the new class, Edward could write:<br>
&gt;<br>
&gt; class BitTraversable i where<br>
&gt;   traverseBits :: &lt;sometype&gt;<br>
&gt;<br>
&gt; instance (BitSize i) =&gt; BitTraversable i where<br>
&gt;   traverseBits = &lt;something&gt;<br>
&gt;<br>
&gt; instance BitTraversable Integer where<br>
&gt;   traverseBits = &lt;something else&gt;<br>
&gt;<br>
<br>
</div>I should add that this approach looks like it would require<br>
OverlappingInstances.</blockquote><div><br></div><div>Correct. This is not a viable solution for the problem, also it precludes the existance of support for someone else&#39;s Natural number type, etc.</div><div><br></div>
<div>Every type that is currently an instance of Bits is either of a fixed size or potentially infinite.</div><div><br></div><div>Changing bitSize to return a Maybe a works. Making a separate BitSize class simply forces me to do exactly what I&#39;m doing right now, which is ignore it and manually probe. </div>
<div><br></div><div>I&#39;m a strong -1 vote to any solution that splits BitSize out into a separate class.</div><div><br></div><div>-Edward</div></div>