{-# 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# x# :: Word# x#) (I# 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# x# :: Word# x#) (I# i# :: Int# i#) = Word# -> Word W# (Word# x# Word# -> Int# -> Word# `uncheckedShiftRL#` Int# i#) {-# INLINE unsafeShiftR #-}