@@ -953,8 +953,8 @@ choice _ps = undefined
954{-# INLINE manyP #-}
954{-# INLINE manyP #-}
955manyP :: -- MonadCatch m =>
955manyP :: -- MonadCatch m =>
956− Parser m b c -> Parser m a b -> Parser m a c
956+ Parser m a b -> Parser m b c -> Parser m a c
957−manyP _f _p = undefined -- K.toParserK $ D.manyP f (K.fromParserK p)
957+manyP _p _f = undefined -- K.toParserK $ D.manyP (K.fromParserK p) f
959-- | Collect zero or more parses. Apply the supplied parser repeatedly on the
959-- | Collect zero or more parses. Apply the supplied parser repeatedly on the
960-- input stream and push the parse results to a downstream fold.
960-- 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)
967-- /Pre-release/
967-- /Pre-release/
969{-# INLINE many #-}
969{-# INLINE many #-}
970−many :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
970+many :: MonadCatch m => Parser m a b -> Fold m b c -> Parser m a c
971−many f p = K.toParserK $ D.many f (K.fromParserK p)
971+many p f = K.toParserK $ D.many (K.fromParserK p) f
972-- many = countBetween 0 maxBound
972-- many = countBetween 0 maxBound
974-- Note: many1 would perhaps be a better name for this and consistent with
974-- 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)
988-- /Pre-release/
988-- /Pre-release/
990{-# INLINE some #-}
990{-# INLINE some #-}
991−some :: MonadCatch m => Fold m b c -> Parser m a b -> Parser m a c
991+some :: MonadCatch m => Parser m a b -> Fold m b c -> Parser m a c
992−some f p = K.toParserK $ D.some f (K.fromParserK p)
992+some p f = K.toParserK $ D.some (K.fromParserK p) f
993−-- some f p = manyP (takeGE 1 f) p
993+-- some p f = manyP p (takeGE 1 f)
994-- many = countBetween 1 maxBound
994-- many = countBetween 1 maxBound
996-- | @countBetween m n f p@ collects between @m@ and @n@ sequential parses of
996-- | @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)
1002{-# INLINE countBetween #-}
1002{-# INLINE countBetween #-}
1003countBetween ::
1003countBetween ::
1004 -- MonadCatch m =>
1004 -- MonadCatch m =>
1005− Int -> Int -> Fold m b c -> Parser m a b -> Parser m a c
1005+ Int -> Int -> Parser m a b -> Fold m b c -> Parser m a c
1006−countBetween _m _n _f = undefined
1006+countBetween _m _n _p = undefined
1007−-- countBetween m n f p = manyP (takeBetween m n f) p
1007+-- countBetween m n p f = manyP (takeBetween m n f) p
1009-- | @count n f p@ collects exactly @n@ sequential parses of parser @p@ using
1009-- | @count n f p@ collects exactly @n@ sequential parses of parser @p@ using
1010-- the fold @f@. Fails if the input ends or the parser fails before @n@
1010-- the fold @f@. Fails if the input ends or the parser fails before @n@
@@ -1015,9 +1015,9 @@ countBetween _m _n _f = undefined
1015{-# INLINE count #-}
1015{-# INLINE count #-}
1017 -- MonadCatch m =>
1017 -- 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
1019count n = countBetween n n
1019count n = countBetween n n
1020−-- count n f p = manyP (takeEQ n f) p
1020+-- count n p f = manyP (takeEQ n f) p
1022-- | Like 'manyTill' but uses a 'Parser' to collect the results instead of a
1022-- | Like 'manyTill' but uses a 'Parser' to collect the results instead of a
1023-- 'Fold'. Parsing stops or fails if the collecting parser stops or fails.
1023-- 'Fold'. Parsing stops or fails if the collecting parser stops or fails.
@@ -1032,9 +1032,9 @@ count n = countBetween n n
1033{-# INLINE manyTillP #-}
1033{-# INLINE manyTillP #-}
1034manyTillP :: -- MonadCatch m =>
1034manyTillP :: -- MonadCatch m =>
1035− Parser m b c -> Parser m a b -> Parser m a x -> Parser m a c
1035+ Parser m a b -> Parser m a x -> Parser m b c -> Parser m a c
1036−manyTillP _f _p1 _p2 = undefined
1036+manyTillP _p1 _p2 _f = undefined
1037− -- K.toParserK $ D.manyTillP f (K.fromParserK p1) (K.fromParserK p2)
1037+ -- K.toParserK $ D.manyTillP (K.fromParserK p1) (K.fromParserK p2) f
1039-- | @manyTill f collect test@ tries the parser @test@ on the input, if @test@
1039-- | @manyTill f collect test@ tries the parser @test@ on the input, if @test@
1040-- fails it backtracks and tries @collect@, after @collect@ succeeds @test@ is
1040-- fails it backtracks and tries @collect@, after @collect@ succeeds @test@ is
@@ -1048,8 +1048,8 @@ manyTillP _f _p1 _p2 = undefined
1049{-# INLINE manyTill #-}
1049{-# INLINE manyTill #-}
1050manyTill :: MonadCatch m
1050manyTill :: MonadCatch m
1051− => Fold m b c -> Parser m a b -> Parser m a x -> Parser m a c
1051+ => Parser m a b -> Parser m a x -> Fold m b c -> Parser m a c
1052−manyTill f p1 p2 =
1052+manyTill p1 p2 f =
1053 K.toParserK $ D.manyTill f (K.fromParserK p1) (K.fromParserK p2)
1053 K.toParserK $ D.manyTill f (K.fromParserK p1) (K.fromParserK p2)
1055-- | @manyThen f collect recover@ repeats the parser @collect@ on the input and
1055-- | @manyThen f collect recover@ repeats the parser @collect@ on the input and
@@ -1064,8 +1064,8 @@ manyTill f p1 p2 =
1065{-# INLINE manyThen #-}
1065{-# INLINE manyThen #-}
1066manyThen :: -- (Foldable t, MonadCatch m) =>
1066manyThen :: -- (Foldable t, MonadCatch m) =>
1067− Fold m b c -> Parser m a b -> Parser m a x -> Parser m a c
1067+ Parser m a b -> Parser m a x -> Fold m b c -> Parser m a c
1068−manyThen _f _parser _recover = undefined
1068+manyThen _parser _recover _f = undefined
1070-------------------------------------------------------------------------------
1070-------------------------------------------------------------------------------
1071-- Interleaving a collection of parsers
1071-- Interleaving a collection of parsers
@@ -1079,8 +1079,8 @@ manyThen _f _parser _recover = undefined
1080{-# INLINE roundRobin #-}
1080{-# INLINE roundRobin #-}
1081roundRobin :: -- (Foldable t, MonadCatch m) =>
1081roundRobin :: -- (Foldable t, MonadCatch m) =>
1082− Fold m b c -> t (Parser m a b) -> Parser m a c
1082+ t (Parser m a b) -> Fold m b c -> Parser m a c
1083−roundRobin _f _ps = undefined
1083+roundRobin _ps _f = undefined
1085-------------------------------------------------------------------------------
1085-------------------------------------------------------------------------------
1086-- Repeated Alternatives
1086-- Repeated Alternatives
@@ -1094,8 +1094,8 @@ roundRobin _f _ps = undefined
1095{-# INLINE retryMaxTotal #-}
1095{-# INLINE retryMaxTotal #-}
1096retryMaxTotal :: -- (MonadCatch m) =>
1096retryMaxTotal :: -- (MonadCatch m) =>
1097− Int -> Fold m b c -> Parser m a b -> Parser m a c
1097+ Int -> Parser m a b -> Fold m b c -> Parser m a c
1098−retryMaxTotal _n _f _p = undefined
1098+retryMaxTotal _n _p _f = undefined
1100-- | Like 'retryMaxTotal' but aborts after @n@ successive failures.
1100-- | Like 'retryMaxTotal' but aborts after @n@ successive failures.
@@ -1103,8 +1103,8 @@ retryMaxTotal _n _f _p = undefined
1104{-# INLINE retryMaxSuccessive #-}
1104{-# INLINE retryMaxSuccessive #-}
1105retryMaxSuccessive :: -- (MonadCatch m) =>
1105retryMaxSuccessive :: -- (MonadCatch m) =>
1106− Int -> Fold m b c -> Parser m a b -> Parser m a c
1106+ Int -> Parser m a b -> Fold m b c -> Parser m a c
1107−retryMaxSuccessive _n _f _p = undefined
1107+retryMaxSuccessive _n _p _f = undefined
1109-- | Keep trying a parser until it succeeds. When the parser fails the input
1109-- | Keep trying a parser until it succeeds. When the parser fails the input
1110-- consumed till now is dropped and the new instance is tried on the fresh
1110-- consumed till now is dropped and the new instance is tried on the fresh