defP p s = P.parse p s `P.feed` B.empty

-satisfy ~~(w,s)~~ = maybeP (P.satisfy (<=w)) (B.cons w s) == Just w

+satisfy w s = maybeP (P.satisfy (<=w)) (B.cons w s) == Just w

-word8 ~~(w,s)~~ = maybeP (P.word8 w) (B.cons w s) == Just w

+word8 w s = maybeP (P.word8 w) (B.cons w s) == Just w

anyWord8 s = maybeP P.anyWord8 s == if B.null s

-notWord8 ~~(w, ~~NonEmpty s) = maybeP (P.notWord8 w) s == if v == w

+notWord8 w (NonEmpty s) = maybeP (P.notWord8 w) s == if v == w

string s = maybeP (P.string s) s == Just s

let t = B.dropWhile (<=w) s

in case defP (P.skipWhile (<=w)) s of

-takeCount (Positive k~~,s)~~ =

+takeCount (Positive k) s =

case maybeP (P.take k) s of

Nothing -> k > B.length s

Just s' -> k <= B.length s

let (h,t) = B.span (==w) s

in case defP (P.takeWhile (==w)) s of

P.Done t' h' -> t == t' && h == h'

in case defP (P.takeWhile1 (<=w)) s' of

P.Done t' h' -> t == t' && h == h'

let (h,t) = B.break (==w) s

in case defP (P.takeTill (==w)) s of

P.Done t' h' -> t == t' && h == h'

-ensure n s = case defP (P.ensure n) s of

- P.Done _ () -> B.length s >= n

+ensure n s = case defP (P.ensure m) s of

+ P.Done _ () -> B.length s >= m

+ where m = (n `mod` 220) - 20

takeWhile1_empty = maybeP (P.takeWhile1 undefined) B.empty == Nothing

testProperty "endOfInput" endOfInput,

testProperty "ensure" ensure