Zero Fill Right Shift in Haskell?

Viewed 311

I'm having a little tinker with Haskell (and thouroughly enjoying myself) and I now want to do a zero-fill right shift.

I trotted on over to hackage and found Data.Bits, whipped up ghci and here's what I typed (well, I didn't type the -3 of course):

:m Data.Bits   
shiftR (-9) 2
-3

Fantatstic, a regular right shift, just what I expected.

OK, now I'll actually read the docs. OK, I see unsafeShiftR, but that's not quite what I want.

So, what have I missed? Is there a zero-fill right shift function available to me in Haskell somewhere (i.e. one that returns 1073741821 when -9 is shifted right by 2)?

1 Answers
Related