Adding unsafeShiftL, unsafeShiftR to Data.Bits(Bits)

Simon Marlow marlowsd at gmail.com
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:

http://hackage.haskell.org/trac/ghc/attachment/ticket/5414/0001-Add-unsafeShift-to-Data.Bits.patch

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?

Cheers,
	Simon



More information about the Libraries mailing list