{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# LANGUAGE BangPatterns, PatternGuards #-}
module Data.Bits.Compat (
module Base
, bitDefault
, testBitDefault
, popCountDefault
, (.^.)
, (.>>.)
, (.<<.)
, (!>>.)
, (!<<.)
, toIntegralSized
, oneBits
) where
import Data.Bits as Base
#if !(MIN_VERSION_base(4,17,0))
import Prelude
#endif
#if !(MIN_VERSION_base(4,17,0))
(.^.) :: (Bits a) => a -> a -> a
(.^.) = xor
infixl 6 .^.
(.>>.) :: (Bits a) => a -> Int -> a
(.>>.) = shiftR
infixl 8 .>>.
(.<<.) :: (Bits a) => a -> Int -> a
(.<<.) = shiftL
infixl 8 .<<.
(!>>.) :: (Bits a) => a -> Int -> a
(!>>.) = unsafeShiftR
infixl 8 !>>.
(!<<.) :: (Bits a) => a -> Int -> a
(!<<.) = unsafeShiftL
infixl 8 !<<.
#endif
#if !(MIN_VERSION_base(4,16,0))
oneBits :: (FiniteBits a) => a
oneBits = complement zeroBits
{-# INLINE oneBits #-}
#endif