I like the discussion, but I'm not sold on the solution :).
In particular, the {n+1} bit is not immediatly clear to me, it seems like the number of original number of bits is increasing hah!
**The Haskell programming language community.** Daily news and info about all things Haskell related: practical stuff, theory, types, libraries, jobs, patches, releases, events and conferences and more... ### Links - Get Started with Haskell
I like the discussion, but I'm not sold on the solution :).
In particular, the {n+1} bit is not immediatly clear to me, it seems like the number of original number of bits is increasing hah!
Good point. I was thinking of transformation that preserve the length of the bitstring like if you're dealing with a type like Word64
. Otherwise perhaps you could be more specific about it like this:
.{m}10{n} -> 1{m}0{n+1}
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.
I guess you could express it more Haskelly like:
padL 64 1 (cons 1 (takeWhileR (== 0) x))
(if we consider bitstrings to be Seq Bit
and I hope that padL
speaks for itself)
Would that be less confusing? Or can you try to explain what you find confusing?