Well, it turns out isEmpty is not actually sufficient for my needs (but useful anyway).
let f xs = isEmpty >>= \b ->
if b
then return xs
else (getWord8 7) >>= \x -> f (x:xs)
in
not (L.null bs) ==>
fromIntegral (length (runGet (runBitGet $ f []) bs)) == (8 * L.length bs `div` 7)
oops, "demandInput: not enough bytes"
I'd be glad to hear suggestions on how to implement Alternative instance for BitGet.
Well, it turns out isEmpty is not actually sufficient for my needs (but useful anyway).
oops, "demandInput: not enough bytes"
I'd be glad to hear suggestions on how to implement Alternative instance for BitGet.