<div dir="auto">popCount is a perfectly sensible method for Natural, and it could theoretically become one for Integer as well if we say that, whenever there's an infinite number of 1s and a finite number of 0s, then the result is -(1 + count of 0s), as though it were maxBound :: Word bits in size and merely converted to an Int (a sensible assumption, considering memory limits). The results for types where there can be both infinite 0s and 1s should still be an error.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 30, 2019, 09:21 Oleg Grenrus <<a href="mailto:oleg.grenrus@iki.fi">oleg.grenrus@iki.fi</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Although, popCount for Integer/Natural kind of makes sense, as they <br>
aren't infinite list of [Bit]s, but smarter structure.<br>
<br>
On 30.11.2019 17.17, Oleg Grenrus wrote:<br>
> I propose to change it to be member of FiniteBits<br>
><br>
> I recall, there was a proposal to remove bitSize from Bits, so it's an <br>
> opportunity to introduce another small, yet breaking change at the <br>
> same time.<br>
><br>
> Discussion time 2 week.<br>
><br>
> - Oleg<br>
><br>
> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>