Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/Data/BitVector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ import Prelude
, flip, fromIntegral
, maxBound
, snd
, undefined
, ($), (.), (^), (++)
)

Expand Down Expand Up @@ -757,9 +756,9 @@ instance Bits BV where
testBit (BV n a) i | i < n = testBit a i
| otherwise = False
{-# INLINE testBit #-}
bitSize = undefined
bitSize = width
#if MIN_VERSION_base(4,7,0)
bitSizeMaybe = const Nothing
bitSizeMaybe = Just . width
#endif
isSigned = const False
shiftL (BV n a) k
Expand Down Expand Up @@ -791,6 +790,11 @@ instance Bits BV where
popCount (BV _ a) = assert (a >= 0) $ popCount a
{-# INLINE popCount #-}

#if MIN_VERSION_base(4,7,0)
instance FiniteBits BV where
finiteBitSize = width
#endif

-- | An alias for 'complement'.
not :: BV -> BV
not = complement
Expand Down