@@ -430,7 +430,9 @@ getLazyByteString n = do
430-- | Test whether all input has been consumed, i.e. there are no remaining
430-- | Test whether all input has been consumed, i.e. there are no remaining
431-- undecoded bytes.
431-- undecoded bytes.
432isEmpty :: BitGet Bool
432isEmpty :: BitGet Bool
433+isEmpty = B $ \ (S bs o) -> if B.null bs
433−isEmpty = B $ \ (S bs o) -> B.isEmpty >>= \e -> return (S bs o, e)
434+ then B.isEmpty >>= \e -> return (S bs o, e)
435+ else return (S bs o, False)
435-- | Read a 1 bit 'Bool'.
437-- | Read a 1 bit 'Bool'.
436bool :: Block Bool
438bool :: Block Bool