Error out of invalid Int/Word bit shifts
Although the Haddock's for shiftL
and shiftR
do require the number
of bits to be non-negative, we should still check this before calling
out to primitives (which also have undefined behaviour for negative bit
shifts).
If a user really wants to bypass checks that the number of bits is
sensible, they already have the aptly-named unsafeShiftL
/unsafeShiftR
at their disposal.
See #16111 (closed).