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.

On Sat, Nov 30, 2019, 09:21 Oleg Grenrus <oleg.grenrus@iki.fi> wrote:
Although, popCount for Integer/Natural kind of makes sense, as they
aren't infinite list of [Bit]s, but smarter structure.

On 30.11.2019 17.17, Oleg Grenrus wrote:
> I propose to change it to be member of FiniteBits
>
> I recall, there was a proposal to remove bitSize from Bits, so it's an
> opportunity to introduce another small, yet breaking change at the
> same time.
>
> Discussion time 2 week.
>
> - Oleg
>
> _______________________________________________
> Libraries mailing list
> Libraries@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries