Adding unsafeShiftL, unsafeShiftR to Data.Bits(Bits)

Simon Marlow marlowsd at
Tue Aug 16 16:06:24 CEST 2011

Johan Tibell has proposed that we add unsafeShiftL and unsafeShiftR 
methods to the Bits class, as per the patch here:

I've talked this through with Johan, and we came to the conclusion that 
while "unsafeShiftL" is a bit unsightly, this is the most workable 
solution.  For example, optimising away the test in shiftL directly in 
the backend is not possible when compiling via LLVM, which only provides 
the unsafe operation as a primitive.

Any objections before I push this in?


More information about the Libraries mailing list