@@ -212,10 +212,10 @@ prop_fail lbs errMsg0 = forAll (choose (0, 8 * L.length lbs)) $ \len ->
212 _ -> False
212 _ -> False
214-- | number of bits required to write @v@
214-- | number of bits required to write @v@
215−bitreq :: (Num b, Bits a, Ord a) => a -> b
215+bitreq :: (Num b, Num a, Bits a, Ord a) => a -> b
216bitreq v = fromIntegral . head $ [ req | (req, top) <- bittable, v <= top ]
216bitreq v = fromIntegral . head $ [ req | (req, top) <- bittable, v <= top ]
218−bittable :: Bits a => [(Integer, a)]
218+bittable :: (Bits a, Num a) => [(Integer, a)]
219bittable = [ (fromIntegral x, (1 `shiftL` x) - 1) | x <- [1..64] ]
219bittable = [ (fromIntegral x, (1 `shiftL` x) - 1) | x <- [1..64] ]
221prop_bitreq :: W Word64 -> Property
221prop_bitreq :: W Word64 -> Property
@@ -238,7 +238,7 @@ prop_composite_case b (W w) = w < 0x8000 ==>
238 w' = runGet (runBitGet g) lbs
238 w' = runGet (runBitGet g) lbs
239 in w == w'
239 in w == w'
241−prop_compare_put_with_naive :: (Bits a, BinaryBit a, Ord a) => W [a] -> Property
241+prop_compare_put_with_naive :: (Bits a, BinaryBit a, Ord a, Num a) => W [a] -> Property
242prop_compare_put_with_naive (W ws) = property $
242prop_compare_put_with_naive (W ws) = property $
243 let pn = mapM_ (\v -> naive_put (bitreq v) v) ws
243 let pn = mapM_ (\v -> naive_put (bitreq v) v) ws
244 p = mapM_ (\v -> putBits (bitreq v) v) ws
244 p = mapM_ (\v -> putBits (bitreq v) v) ws