@@ -271,7 +271,7 @@ prop_composite_case b (W w) = w < 0x8000 ==>
271 putWord16be 15 w
271 putWord16be 15 w
272 g = do v <- getBool
272 g = do v <- getBool
273 case v of
273 case v of
274− True -> getWord16be 15
274+ True -> getWord16 15
275 False -> do
275 False -> do
276 msb <- getWord8 7
276 msb <- getWord8 7
277 lsb <- getWord8 8
277 lsb <- getWord8 8
@@ -395,7 +395,7 @@ type Program = [Primitive]
395instance Arbitrary Primitive where
395instance Arbitrary Primitive where
396 arbitrary = do
396 arbitrary = do
397 let gen c = do
397 let gen c = do
398− let (maxBits, _) = (\w -> (bitSize w, c undefined w)) undefined
398+ let (maxBits, _) = (\w -> (finiteBitSize w, c undefined w)) undefined
399 bits <- choose (0, maxBits)
399 bits <- choose (0, maxBits)
400 n <- choose (0, fromIntegral (2^bits-1))
400 n <- choose (0, fromIntegral (2^bits-1))
401 return (c bits n)
401 return (c bits n)
@@ -458,9 +458,9 @@ getPrimitive p =
458 case p of
458 case p of
459 Bool _ -> Bool <$> getBool
459 Bool _ -> Bool <$> getBool
460 W8 n _ -> W8 n <$> getWord8 n
460 W8 n _ -> W8 n <$> getWord8 n
461− W16 n _ -> W16 n <$> getWord16be n
461+ W16 n _ -> W16 n <$> getWord16 n
462− W32 n _ -> W32 n <$> getWord32be n
462+ W32 n _ -> W32 n <$> getWord32 n
463− W64 n _ -> W64 n <$> getWord64be n
463+ W64 n _ -> W64 n <$> getWord64 n
464 BS n _ -> BS n <$> getByteString n
464 BS n _ -> BS n <$> getByteString n
465 LBS n _ -> LBS n <$> getLazyByteString n
465 LBS n _ -> LBS n <$> getLazyByteString n
466 IsEmpty -> isEmpty >> return IsEmpty
466 IsEmpty -> isEmpty >> return IsEmpty
@@ -474,9 +474,9 @@ verifyProgram totalLength ps0 = go 0 ps0
474 case p of
474 case p of
475 Bool x -> check x getBool >> go (pos+1) ps
475 Bool x -> check x getBool >> go (pos+1) ps
476 W8 n x -> check x (getWord8 n) >> go (pos+n) ps
476 W8 n x -> check x (getWord8 n) >> go (pos+n) ps
477− W16 n x -> check x (getWord16be n) >> go (pos+n) ps
477+ W16 n x -> check x (getWord16 n) >> go (pos+n) ps
478− W32 n x -> check x (getWord32be n) >> go (pos+n) ps
478+ W32 n x -> check x (getWord32 n) >> go (pos+n) ps
479− W64 n x -> check x (getWord64be n) >> go (pos+n) ps
479+ W64 n x -> check x (getWord64 n) >> go (pos+n) ps
480 BS n x -> check x (getByteString n) >> go (pos+(8*n)) ps
480 BS n x -> check x (getByteString n) >> go (pos+(8*n)) ps
481 LBS n x -> check x (getLazyByteString n) >> go (pos+(8*n)) ps
481 LBS n x -> check x (getLazyByteString n) >> go (pos+(8*n)) ps
482 IsEmpty -> do
482 IsEmpty -> do