I think your version is arguably even more confusing, though I certainly wish we had something clearer. If you can suggest something clearer and equally fast available using extant primitives/instructions, I'm all ears and will happily make the change.
Since this is a very new community, let's take a moment to introduce ourselves in this thread. Please share your interests and what you are working on!
I'm David Feuer. I maintain containers, co-maintain unordered-containers and pqueue, and contribute to various other projects. Data structures are fun. I'm a good person to talk to about laziness subtleties, and about whether particular applications of unsafe IO are safe in context.
Bitstring manipulation
The containers package contains IntMap and IntSet types which use some bit fiddling tricks to achieve very high performance....
Introduce Yourself
Since this is a very new community, let's take a moment to introduce ourselves in this thread. Please share your interests and what you are working on!