Commits

Iago Abal committed 67b817d

Minor tweaks

  • Participants
  • Parent commits b9dd97f

Comments (0)

Files changed (1)

File Data/BitVector.hs

   , fromBool
   , fromBits
   , toBits
-  -- Pretty-printing
+  -- * Pretty-printing
   , showBin
   , showOct
   , showHex
 --
 width :: BV -> Int
 width = size
+{-# INLINE width #-}
 
 -- | An alias for 'nat'.
 --
 uint :: BV -> Integer
 uint = nat
+{-# INLINE uint #-}
 
 -- | 2's complement value of a bit-vector.
 int :: BV -> Integer
 bitVec :: Integral a => Int -> a -> BV
 bitVec n a | a >= 0    = BV n $ fromIntegral a
            | otherwise = negate $ BV n $ fromIntegral (-a)
-{-# INLINE bitVec #-}
+{-# RULES "bitVec/Integer" bitVec = BV #-}
+{-# SPECIALIZE bitVec :: Int -> Int -> BV #-}
+{-# INLINE[1] bitVec #-}
 
 -- | Create a mask of ones.
 --