I have a little mess with Haskell (and you're enjoying me), and now I want to do a zero fill of the right shift .
I switched to hacks and found Data.Bits hacked by ghci , and here is what I typed (well, of course, I did not type -3):
:m Data.Bits shiftR (-9) 2 -3
Fantastic, regular right shift, exactly what I expected.
OK, now I really read the documents. Ok, I see unsafeShiftR , but thatβs not quite what I want.
So what have I missed? Is there a zero padding shift function for me in Haskell somewhere (i.e. the one that returns 1073741821 when -9 shifts right by 2)?
source share