clearBit @Natural allocates more than necessary
The current definition is
clearBit x i = x `xor` (bit i .&. x)
It seems that this implementation would allocate intermediate Natural
s as the result the bit
and (.&.)
functions. It should be possible to avoid these allocations by using the underlying primitives such as bigNatClearBit#
.