{-# LANGUAGE MagicHash #-} module Data.HashMap.UnsafeShift ( unsafeShiftL , unsafeShiftR ) where import GHC.Exts (Word(W#), Int(I#), uncheckedShiftL#, uncheckedShiftRL#) unsafeShiftL :: Word -> Int -> Word unsafeShiftL :: Word -> Int -> Word unsafeShiftL (W# Word# x#) (I# Int# i#) = Word# -> Word W# (Word# x# Word# -> Int# -> Word# `uncheckedShiftL#` Int# i#) {-# INLINE unsafeShiftL #-} unsafeShiftR :: Word -> Int -> Word unsafeShiftR :: Word -> Int -> Word unsafeShiftR (W# Word# x#) (I# Int# i#) = Word# -> Word W# (Word# x# Word# -> Int# -> Word# `uncheckedShiftRL#` Int# i#) {-# INLINE unsafeShiftR #-}