@@ -953,8 +953,8 @@ choice _ps = undefined
953953--
954954{-# INLINE manyP #-}
955955manyP :: -- MonadCatch m =>
956− Parser m b c -> Parser m a b -> Parser m a c
957−manyP _f _p = undefined -- K.toParserK $ D.manyP f (K.fromParserK p)
956+ Parser m a b -> Parser m b c -> Parser m a c
957+manyP _p _f = undefined -- K.toParserK $ D.manyP (K.fromParserK p) f
958958
959959-- | Collect zero or more parses. Apply the supplied parser repeatedly on the
960960-- input stream and push the parse results to a downstream fold.
@@ -967,8 +967,8 @@ manyP _f _p = undefined -- K.toParserK $ D.manyP f (K.fromParserK p)
967967-- /Pre-release/
968968--
969969{-# INLINE many #-}
970−many :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
971−many f p = K.toParserK $ D.many f (K.fromParserK p)
970+many :: MonadCatch m => Parser m a b -> Fold m b c -> Parser m a c
971+many p f = K.toParserK $ D.many (K.fromParserK p) f
972972-- many = countBetween 0 maxBound
973973
974974-- Note: many1 would perhaps be a better name for this and consistent with
@@ -988,9 +988,9 @@ many f p = K.toParserK $ D.many f (K.fromParserK p)
988988-- /Pre-release/
989989--
990990{-# INLINE some #-}
991−some :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
992−some f p = K.toParserK $ D.some f (K.fromParserK p)
993−-- some f p = manyP (takeGE 1 f) p
991+some :: MonadCatch m => Parser m a b -> Fold m b c -> Parser m a c
992+some p f = K.toParserK $ D.some (K.fromParserK p) f
993+-- some p f = manyP p (takeGE 1 f)
994994-- many = countBetween 1 maxBound
995995
996996-- | @countBetween m n f p@ collects between @m@ and @n@ sequential parses of
@@ -1002,9 +1002,9 @@ some f p = K.toParserK $ D.some f (K.fromParserK p)
10021002{-# INLINE countBetween #-}
10031003countBetween ::
10041004 -- MonadCatch m =>
1005− Int -> Int -> Fold m b c -> Parser m a b -> Parser m a c
1006−countBetween _m _n _f = undefined
1007−-- countBetween m n f p = manyP (takeBetween m n f) p
1005+ Int -> Int -> Parser m a b -> Fold m b c -> Parser m a c
1006+countBetween _m _n _p = undefined
1007+-- countBetween m n p f = manyP (takeBetween m n f) p
10081008
10091009-- | @count n f p@ collects exactly @n@ sequential parses of parser @p@ using
10101010-- the fold @f@. Fails if the input ends or the parser fails before @n@
@@ -1015,9 +1015,9 @@ countBetween _m _n _f = undefined
10151015{-# INLINE count #-}
10161016count ::
10171017 -- MonadCatch m =>
1018− Int -> Fold m b c -> Parser m a b -> Parser m a c
1018+ Int -> Parser m a b -> Fold m b c -> Parser m a c
10191019count n = countBetween n n
1020−-- count n f p = manyP (takeEQ n f) p
1020+-- count n p f = manyP (takeEQ n f) p
10211021
10221022-- | Like 'manyTill' but uses a 'Parser' to collect the results instead of a
10231023-- 'Fold'. Parsing stops or fails if the collecting parser stops or fails.
@@ -1032,9 +1032,9 @@ count n = countBetween n n
10321032--
10331033{-# INLINE manyTillP #-}
10341034manyTillP :: -- MonadCatch m =>
1035− Parser m b c -> Parser m a b -> Parser m a x -> Parser m a c
1036−manyTillP _f _p1 _p2 = undefined
1037− -- K.toParserK $ D.manyTillP f (K.fromParserK p1) (K.fromParserK p2)
1035+ Parser m a b -> Parser m a x -> Parser m b c -> Parser m a c
1036+manyTillP _p1 _p2 _f = undefined
1037+ -- K.toParserK $ D.manyTillP (K.fromParserK p1) (K.fromParserK p2) f
10381038
10391039-- | @manyTill f collect test@ tries the parser @test@ on the input, if @test@
10401040-- fails it backtracks and tries @collect@, after @collect@ succeeds @test@ is
@@ -1048,8 +1048,8 @@ manyTillP _f _p1 _p2 = undefined
10481048--
10491049{-# INLINE manyTill #-}
10501050manyTill :: MonadCatch m
1051− => Fold m b c -> Parser m a b -> Parser m a x -> Parser m a c
1052−manyTill f p1 p2 =
1051+ => Parser m a b -> Parser m a x -> Fold m b c -> Parser m a c
1052+manyTill p1 p2 f =
10531053 K.toParserK $ D.manyTill f (K.fromParserK p1) (K.fromParserK p2)
10541054
10551055-- | @manyThen f collect recover@ repeats the parser @collect@ on the input and
@@ -1064,8 +1064,8 @@ manyTill f p1 p2 =
10641064--
10651065{-# INLINE manyThen #-}
10661066manyThen :: -- (Foldable t, MonadCatch m) =>
1067− Fold m b c -> Parser m a b -> Parser m a x -> Parser m a c
1068−manyThen _f _parser _recover = undefined
1067+ Parser m a b -> Parser m a x -> Fold m b c -> Parser m a c
1068+manyThen _parser _recover _f = undefined
10691069
10701070-------------------------------------------------------------------------------
10711071-- Interleaving a collection of parsers
@@ -1079,8 +1079,8 @@ manyThen _f _parser _recover = undefined
10791079--
10801080{-# INLINE roundRobin #-}
10811081roundRobin :: -- (Foldable t, MonadCatch m) =>
1082− Fold m b c -> t (Parser m a b) -> Parser m a c
1083−roundRobin _f _ps = undefined
1082+ t (Parser m a b) -> Fold m b c -> Parser m a c
1083+roundRobin _ps _f = undefined
10841084
10851085-------------------------------------------------------------------------------
10861086-- Repeated Alternatives
@@ -1094,8 +1094,8 @@ roundRobin _f _ps = undefined
10941094--
10951095{-# INLINE retryMaxTotal #-}
10961096retryMaxTotal :: -- (MonadCatch m) =>
1097− Int -> Fold m b c -> Parser m a b -> Parser m a c
1098−retryMaxTotal _n _f _p = undefined
1097+ Int -> Parser m a b -> Fold m b c -> Parser m a c
1098+retryMaxTotal _n _p _f = undefined
10991099
11001100-- | Like 'retryMaxTotal' but aborts after @n@ successive failures.
11011101--
@@ -1103,8 +1103,8 @@ retryMaxTotal _n _f _p = undefined
11031103--
11041104{-# INLINE retryMaxSuccessive #-}
11051105retryMaxSuccessive :: -- (MonadCatch m) =>
1106− Int -> Fold m b c -> Parser m a b -> Parser m a c
1107−retryMaxSuccessive _n _f _p = undefined
1106+ Int -> Parser m a b -> Fold m b c -> Parser m a c
1107+retryMaxSuccessive _n _p _f = undefined
11081108
11091109-- | Keep trying a parser until it succeeds. When the parser fails the input
11101110-- consumed till now is dropped and the new instance is tried on the fresh