@@ -290,7 +290,7 @@ import Prelude hiding
290-- /Pre-release/
290-- /Pre-release/
292{-# INLINE toFold #-}
292{-# INLINE toFold #-}
293−toFold :: Monad m => Parser m a b -> Fold m a b
293+toFold :: Monad m => Parser a m b -> Fold m a b
294toFold p = D.toFold $ D.fromParserK p
294toFold p = D.toFold $ D.fromParserK p
296-------------------------------------------------------------------------------
296-------------------------------------------------------------------------------
@@ -300,7 +300,7 @@ toFold p = D.toFold $ D.fromParserK p
300-- | Make a 'Parser' from a 'Fold'.
300-- | Make a 'Parser' from a 'Fold'.
302{-# INLINE fromFold #-}
302{-# INLINE fromFold #-}
303−fromFold :: Monad m => Fold m a b -> Parser m a b
303+fromFold :: Monad m => Fold m a b -> Parser a m b
304fromFold = D.toParserK . D.fromFold
304fromFold = D.toParserK . D.fromFold
306-- | Convert a Maybe returning fold to an error returning parser. The first
306-- | Convert a Maybe returning fold to an error returning parser. The first
@@ -310,7 +310,7 @@ fromFold = D.toParserK . D.fromFold
310-- /Pre-release/
310-- /Pre-release/
312{-# INLINE fromFoldMaybe #-}
312{-# INLINE fromFoldMaybe #-}
313−fromFoldMaybe :: Monad m => String -> Fold m a (Maybe b) -> Parser m a b
313+fromFoldMaybe :: Monad m => String -> Fold m a (Maybe b) -> Parser a m b
314fromFoldMaybe err = D.toParserK . D.fromFoldMaybe err
314fromFoldMaybe err = D.toParserK . D.fromFoldMaybe err
316-------------------------------------------------------------------------------
316-------------------------------------------------------------------------------
@@ -322,7 +322,7 @@ fromFoldMaybe err = D.toParserK . D.fromFoldMaybe err
322-- | A parser that always yields a pure value without consuming any input.
322-- | A parser that always yields a pure value without consuming any input.
324{-# INLINE [3] fromPure #-}
324{-# INLINE [3] fromPure #-}
325−fromPure :: Monad m => b -> Parser m a b
325+fromPure :: Monad m => b -> Parser a m b
326fromPure = D.toParserK . D.fromPure
326fromPure = D.toParserK . D.fromPure
327{-# RULES "fromPure fallback to CPS" [2]
327{-# RULES "fromPure fallback to CPS" [2]
328 forall a. D.toParserK (D.fromPure a) = K.fromPure a #-}
328 forall a. D.toParserK (D.fromPure a) = K.fromPure a #-}
@@ -333,7 +333,7 @@ fromPure = D.toParserK . D.fromPure
333-- consuming any input.
333-- consuming any input.
335{-# INLINE fromEffect #-}
335{-# INLINE fromEffect #-}
336−fromEffect :: Monad m => m b -> Parser m a b
336+fromEffect :: Monad m => m b -> Parser a m b
337fromEffect = K.fromEffect -- D.toParserK . D.fromEffect
337fromEffect = K.fromEffect -- D.toParserK . D.fromEffect
339-- This is the dual of "nil".
339-- This is the dual of "nil".
@@ -342,7 +342,7 @@ fromEffect = K.fromEffect -- D.toParserK . D.fromEffect
342-- any input.
342-- any input.
344{-# INLINE [3] die #-}
344{-# INLINE [3] die #-}
345−die :: Monad m => String -> Parser m a b
345+die :: Monad m => String -> Parser a m b
346die = D.toParserK . D.die
346die = D.toParserK . D.die
347{-# RULES "die fallback to CPS" [2]
347{-# RULES "die fallback to CPS" [2]
348 forall a. D.toParserK (D.die a) = K.die a #-}
348 forall a. D.toParserK (D.die a) = K.die a #-}
@@ -355,7 +355,7 @@ die = D.toParserK . D.die
355-- /Pre-release/
355-- /Pre-release/
357{-# INLINE dieM #-}
357{-# INLINE dieM #-}
358−dieM :: Monad m => m String -> Parser m a b
358+dieM :: Monad m => m String -> Parser a m b
359dieM = D.toParserK . D.dieM
359dieM = D.toParserK . D.dieM
361-------------------------------------------------------------------------------
361-------------------------------------------------------------------------------
@@ -370,20 +370,20 @@ dieM = D.toParserK . D.dieM
370-- > lmap = Parser.lmapM return
370-- > lmap = Parser.lmapM return
372{-# INLINE lmap #-}
372{-# INLINE lmap #-}
373−lmap :: Monad m => (a -> b) -> Parser m b r -> Parser m a r
373+lmap :: Monad m => (a -> b) -> Parser b m r -> Parser a m r
374lmap f p = D.toParserK $ D.lmap f $ D.fromParserK p
374lmap f p = D.toParserK $ D.lmap f $ D.fromParserK p
376-- | @lmapM f parser@ maps the monadic function @f@ on the input of the parser.
376-- | @lmapM f parser@ maps the monadic function @f@ on the input of the parser.
378{-# INLINE lmapM #-}
378{-# INLINE lmapM #-}
379−lmapM :: Monad m => (a -> m b) -> Parser m b r -> Parser m a r
379+lmapM :: Monad m => (a -> m b) -> Parser b m r -> Parser a m r
380lmapM f p = D.toParserK $ D.lmapM f $ D.fromParserK p
380lmapM f p = D.toParserK $ D.lmapM f $ D.fromParserK p
382-- | @rmapM f parser@ maps the monadic function @f@ on the output of the parser.
382-- | @rmapM f parser@ maps the monadic function @f@ on the output of the parser.
384-- >>> rmap = fmap
384-- >>> rmap = fmap
385{-# INLINE rmapM #-}
385{-# INLINE rmapM #-}
386−rmapM :: Monad m => (b -> m c) -> Parser m a b -> Parser m a c
386+rmapM :: Monad m => (b -> m c) -> Parser a m b -> Parser a m c
387rmapM f p = D.toParserK $ D.rmapM f $ D.fromParserK p
387rmapM f p = D.toParserK $ D.rmapM f $ D.fromParserK p
389-- | Include only those elements that pass a predicate.
389-- | Include only those elements that pass a predicate.
@@ -392,7 +392,7 @@ rmapM f p = D.toParserK $ D.rmapM f $ D.fromParserK p
394{-# INLINE filter #-}
394{-# INLINE filter #-}
395−filter :: Monad m => (a -> Bool) -> Parser m a b -> Parser m a b
395+filter :: Monad m => (a -> Bool) -> Parser a m b -> Parser a m b
396filter f p = D.toParserK $ D.filter f $ D.fromParserK p
396filter f p = D.toParserK $ D.filter f $ D.fromParserK p
398-------------------------------------------------------------------------------
398-------------------------------------------------------------------------------
@@ -410,7 +410,7 @@ filter f p = D.toParserK $ D.filter f $ D.fromParserK p
412{-# INLINE peek #-}
412{-# INLINE peek #-}
413−peek :: Monad m => Parser m a a
413+peek :: Monad m => Parser a m a
414peek = D.toParserK D.peek
414peek = D.toParserK D.peek
416-- | Succeeds if we are at the end of input, fails otherwise.
416-- | Succeeds if we are at the end of input, fails otherwise.
@@ -419,7 +419,7 @@ peek = D.toParserK D.peek
421{-# INLINE eof #-}
421{-# INLINE eof #-}
422−eof :: Monad m => Parser m a ()
422+eof :: Monad m => Parser a m ()
423eof = D.toParserK D.eof
423eof = D.toParserK D.eof
425-- | Returns the next element if it passes the predicate, fails otherwise.
425-- | Returns the next element if it passes the predicate, fails otherwise.
@@ -431,7 +431,7 @@ eof = D.toParserK D.eof
431-- >>> satisfy f = Parser.maybe (toMaybe f)
431-- >>> satisfy f = Parser.maybe (toMaybe f)
433{-# INLINE satisfy #-}
433{-# INLINE satisfy #-}
434−satisfy :: Monad m => (a -> Bool) -> Parser m a a
434+satisfy :: Monad m => (a -> Bool) -> Parser a m a
435satisfy = D.toParserK . D.satisfy
435satisfy = D.toParserK . D.satisfy
437-- | Consume one element from the head of the stream. Fails if it encounters
437-- | Consume one element from the head of the stream. Fails if it encounters
@@ -440,7 +440,7 @@ satisfy = D.toParserK . D.satisfy
440-- >>> one = Parser.satisfy $ const True
440-- >>> one = Parser.satisfy $ const True
442{-# INLINE one #-}
442{-# INLINE one #-}
443−one :: Monad m => Parser m a a
443+one :: Monad m => Parser a m a
444one = satisfy $ const True
444one = satisfy $ const True
446-- Alternate names: "only", "onlyThis".
446-- Alternate names: "only", "onlyThis".
@@ -450,7 +450,7 @@ one = satisfy $ const True
450-- >>> oneEq x = Parser.satisfy (== x)
450-- >>> oneEq x = Parser.satisfy (== x)
452{-# INLINE oneEq #-}
452{-# INLINE oneEq #-}
453−oneEq :: (Monad m, Eq a) => a -> Parser m a a
453+oneEq :: (Monad m, Eq a) => a -> Parser a m a
454oneEq x = satisfy (== x)
454oneEq x = satisfy (== x)
456-- Alternate names: "exclude", "notThis".
456-- Alternate names: "exclude", "notThis".
@@ -460,7 +460,7 @@ oneEq x = satisfy (== x)
460-- >>> oneNotEq x = Parser.satisfy (/= x)
460-- >>> oneNotEq x = Parser.satisfy (/= x)
462{-# INLINE oneNotEq #-}
462{-# INLINE oneNotEq #-}
463−oneNotEq :: (Monad m, Eq a) => a -> Parser m a a
463+oneNotEq :: (Monad m, Eq a) => a -> Parser a m a
464oneNotEq x = satisfy (/= x)
464oneNotEq x = satisfy (/= x)
466-- | Match any one of the elements in the supplied list.
466-- | Match any one of the elements in the supplied list.
@@ -484,7 +484,7 @@ oneNotEq x = satisfy (/= x)
484-- search.
484-- search.
486{-# INLINE oneOf #-}
486{-# INLINE oneOf #-}
487−oneOf :: (Monad m, Eq a, Foldable f) => f a -> Parser m a a
487+oneOf :: (Monad m, Eq a, Foldable f) => f a -> Parser a m a
488oneOf xs = satisfy (`Foldable.elem` xs)
488oneOf xs = satisfy (`Foldable.elem` xs)
490-- | See performance notes in 'oneOf'.
490-- | See performance notes in 'oneOf'.
@@ -492,7 +492,7 @@ oneOf xs = satisfy (`Foldable.elem` xs)
492-- >>> noneOf xs = Parser.satisfy (`Foldable.notElem` xs)
492-- >>> noneOf xs = Parser.satisfy (`Foldable.notElem` xs)
494{-# INLINE noneOf #-}
494{-# INLINE noneOf #-}
495−noneOf :: (Monad m, Eq a, Foldable f) => f a -> Parser m a a
495+noneOf :: (Monad m, Eq a, Foldable f) => f a -> Parser a m a
496noneOf xs = satisfy (`Foldable.notElem` xs)
496noneOf xs = satisfy (`Foldable.notElem` xs)
498-- | Return the next element of the input. Returns 'Nothing'
498-- | Return the next element of the input. Returns 'Nothing'
@@ -502,7 +502,7 @@ noneOf xs = satisfy (`Foldable.notElem` xs)
503{-# DEPRECATED next "Please use \"fromFold Fold.one\" instead" #-}
503{-# DEPRECATED next "Please use \"fromFold Fold.one\" instead" #-}
504{-# INLINE next #-}
504{-# INLINE next #-}
505−next :: Monad m => Parser m a (Maybe a)
505+next :: Monad m => Parser a m (Maybe a)
506next = D.toParserK D.next
506next = D.toParserK D.next
508-- | Map a 'Maybe' returning function on the next element in the stream. The
508-- | Map a 'Maybe' returning function on the next element in the stream. The
@@ -517,7 +517,7 @@ next = D.toParserK D.next
517-- /Pre-release/
517-- /Pre-release/
519{-# INLINE maybe #-}
519{-# INLINE maybe #-}
520−maybe :: Monad m => (a -> Maybe b) -> Parser m a b
520+maybe :: Monad m => (a -> Maybe b) -> Parser a m b
521maybe = D.toParserK . D.maybe
521maybe = D.toParserK . D.maybe
523-- | Map an 'Either' returning function on the next element in the stream. If
523-- | Map an 'Either' returning function on the next element in the stream. If
@@ -527,7 +527,7 @@ maybe = D.toParserK . D.maybe
527-- /Pre-release/
527-- /Pre-release/
529{-# INLINE either #-}
529{-# INLINE either #-}
530−either :: Monad m => (a -> Either String b) -> Parser m a b
530+either :: Monad m => (a -> Either String b) -> Parser a m b
531either = D.toParserK . D.either
531either = D.toParserK . D.either
533-------------------------------------------------------------------------------
533-------------------------------------------------------------------------------
@@ -576,7 +576,7 @@ either = D.toParserK . D.either
577{-# INLINE takeBetween #-}
577{-# INLINE takeBetween #-}
578takeBetween :: Monad m =>
578takeBetween :: Monad m =>
579− Int -> Int -> Fold m a b -> Parser m a b
579+ Int -> Int -> Fold m a b -> Parser a m b
580takeBetween m n = D.toParserK . D.takeBetween m n
580takeBetween m n = D.toParserK . D.takeBetween m n
582-- | Stops after taking exactly @n@ input elements.
582-- | Stops after taking exactly @n@ input elements.
@@ -589,7 +589,7 @@ takeBetween m n = D.toParserK . D.takeBetween m n
589-- *** Exception: ParseError "takeEQ: Expecting exactly 4 elements, input terminated on 3"
589-- *** Exception: ParseError "takeEQ: Expecting exactly 4 elements, input terminated on 3"
591{-# INLINE takeEQ #-}
591{-# INLINE takeEQ #-}
592−takeEQ :: Monad m => Int -> Fold m a b -> Parser m a b
592+takeEQ :: Monad m => Int -> Fold m a b -> Parser a m b
593takeEQ n = D.toParserK . D.takeEQ n
593takeEQ n = D.toParserK . D.takeEQ n
595-- | Take at least @n@ input elements, but can collect more.
595-- | Take at least @n@ input elements, but can collect more.
@@ -607,7 +607,7 @@ takeEQ n = D.toParserK . D.takeEQ n
607-- /Pre-release/
607-- /Pre-release/
609{-# INLINE takeGE #-}
609{-# INLINE takeGE #-}
610−takeGE :: Monad m => Int -> Fold m a b -> Parser m a b
610+takeGE :: Monad m => Int -> Fold m a b -> Parser a m b
611takeGE n = D.toParserK . D.takeGE n
611takeGE n = D.toParserK . D.takeGE n
613-------------------------------------------------------------------------------
613-------------------------------------------------------------------------------
@@ -634,7 +634,7 @@ takeGE n = D.toParserK . D.takeGE n
634-- /Pre-release/
634-- /Pre-release/
636{-# INLINE takeWhileP #-}
636{-# INLINE takeWhileP #-}
637−takeWhileP :: Monad m => (a -> Bool) -> Parser m a b -> Parser m a b
637+takeWhileP :: Monad m => (a -> Bool) -> Parser a m b -> Parser a m b
638takeWhileP cond p = D.toParserK $ D.takeWhileP cond (D.fromParserK p)
638takeWhileP cond p = D.toParserK $ D.takeWhileP cond (D.fromParserK p)
640-- | Collect stream elements until an element fails the predicate. The element
640-- | Collect stream elements until an element fails the predicate. The element
@@ -655,7 +655,7 @@ takeWhileP cond p = D.toParserK $ D.takeWhileP cond (D.fromParserK p)
657{-# INLINE takeWhile #-}
657{-# INLINE takeWhile #-}
658−takeWhile :: Monad m => (a -> Bool) -> Fold m a b -> Parser m a b
658+takeWhile :: Monad m => (a -> Bool) -> Fold m a b -> Parser a m b
659takeWhile cond = D.toParserK . D.takeWhile cond
659takeWhile cond = D.toParserK . D.takeWhile cond
660-- takeWhile cond f = takeWhileP cond (fromFold f)
660-- takeWhile cond f = takeWhileP cond (fromFold f)
@@ -664,7 +664,7 @@ takeWhile cond = D.toParserK . D.takeWhile cond
664-- >>> takeWhile1 cond p = Parser.takeWhileP cond (Parser.takeBetween 1 maxBound p)
664-- >>> takeWhile1 cond p = Parser.takeWhileP cond (Parser.takeBetween 1 maxBound p)
666{-# INLINE takeWhile1 #-}
666{-# INLINE takeWhile1 #-}
667−takeWhile1 :: Monad m => (a -> Bool) -> Fold m a b -> Parser m a b
667+takeWhile1 :: Monad m => (a -> Bool) -> Fold m a b -> Parser a m b
668takeWhile1 cond = D.toParserK . D.takeWhile1 cond
668takeWhile1 cond = D.toParserK . D.takeWhile1 cond
669-- takeWhile1 cond f = takeWhileP cond (takeBetween 1 maxBound f)
669-- takeWhile1 cond f = takeWhileP cond (takeBetween 1 maxBound f)
@@ -676,7 +676,7 @@ takeWhile1 cond = D.toParserK . D.takeWhile1 cond
676-- >>> dropWhile p = Parser.takeWhile p Fold.drain
676-- >>> dropWhile p = Parser.takeWhile p Fold.drain
678{-# INLINE dropWhile #-}
678{-# INLINE dropWhile #-}
679−dropWhile :: Monad m => (a -> Bool) -> Parser m a ()
679+dropWhile :: Monad m => (a -> Bool) -> Parser a m ()
680dropWhile p = takeWhile p FL.drain
680dropWhile p = takeWhile p FL.drain
682-------------------------------------------------------------------------------
682-------------------------------------------------------------------------------
@@ -690,7 +690,7 @@ takeFramedByGeneric :: Monad m =>
690 -> Maybe (a -> Bool)
690 -> Maybe (a -> Bool)
691 -> Maybe (a -> Bool)
691 -> Maybe (a -> Bool)
692 -> Fold m a b
692 -> Fold m a b
693− -> Parser m a b
693+ -> Parser a m b
694takeFramedByGeneric esc begin end f =
694takeFramedByGeneric esc begin end f =
695 D.toParserK $ D.takeFramedByGeneric esc begin end f
695 D.toParserK $ D.takeFramedByGeneric esc begin end f
@@ -712,7 +712,7 @@ takeFramedByGeneric esc begin end f =
712-- /Pre-release/
712-- /Pre-release/
714{-# INLINE takeEndBy #-}
714{-# INLINE takeEndBy #-}
715−takeEndBy :: Monad m => (a -> Bool) -> Parser m a b -> Parser m a b
715+takeEndBy :: Monad m => (a -> Bool) -> Parser a m b -> Parser a m b
716takeEndBy cond = D.toParserK . D.takeEndBy cond . D.fromParserK
716takeEndBy cond = D.toParserK . D.takeEndBy cond . D.fromParserK
717-- takeEndBy = takeEndByEsc (const False)
717-- takeEndBy = takeEndByEsc (const False)
@@ -723,7 +723,7 @@ takeEndBy cond = D.toParserK . D.takeEndBy cond . D.fromParserK
723-- /Pre-release/
723-- /Pre-release/
725{-# INLINE takeEndBy_ #-}
725{-# INLINE takeEndBy_ #-}
726−takeEndBy_ :: Monad m => (a -> Bool) -> Parser m a b -> Parser m a b
726+takeEndBy_ :: Monad m => (a -> Bool) -> Parser a m b -> Parser a m b
727takeEndBy_ cond = D.toParserK . D.takeEndBy_ cond . D.fromParserK
727takeEndBy_ cond = D.toParserK . D.takeEndBy_ cond . D.fromParserK
729takeEndBy_ isEnd p =
729takeEndBy_ isEnd p =
@@ -736,7 +736,7 @@ takeEndBy_ isEnd p =
736-- /Unimplemented/
736-- /Unimplemented/
737{-# INLINE takeEitherSepBy #-}
737{-# INLINE takeEitherSepBy #-}
738takeEitherSepBy :: -- Monad m =>
738takeEitherSepBy :: -- Monad m =>
739− (a -> Bool) -> Fold m (Either a b) c -> Parser m a c
739+ (a -> Bool) -> Fold m (Either a b) c -> Parser a m c
740takeEitherSepBy _cond = undefined -- D.toParserK . D.takeEitherSepBy cond
740takeEitherSepBy _cond = undefined -- D.toParserK . D.takeEitherSepBy cond
742-- | Parse a token that starts with an element chosen by the predicate. The
742-- | Parse a token that starts with an element chosen by the predicate. The
@@ -764,7 +764,7 @@ takeEitherSepBy _cond = undefined -- D.toParserK . D.takeEitherSepBy cond
764-- /Pre-release/
764-- /Pre-release/
766{-# INLINE takeStartBy #-}
766{-# INLINE takeStartBy #-}
767−takeStartBy :: Monad m => (a -> Bool) -> Fold m a b -> Parser m a b
767+takeStartBy :: Monad m => (a -> Bool) -> Fold m a b -> Parser a m b
768takeStartBy cond = D.toParserK . D.takeStartBy cond
768takeStartBy cond = D.toParserK . D.takeStartBy cond
770-- | Like 'takeStartBy' but drops the separator.
770-- | Like 'takeStartBy' but drops the separator.
@@ -772,7 +772,7 @@ takeStartBy cond = D.toParserK . D.takeStartBy cond
772-- >>> takeStartBy_ isBegin = Parser.takeFramedByGeneric Nothing (Just isBegin) Nothing
772-- >>> takeStartBy_ isBegin = Parser.takeFramedByGeneric Nothing (Just isBegin) Nothing
774{-# INLINE takeStartBy_ #-}
774{-# INLINE takeStartBy_ #-}
775−takeStartBy_ :: Monad m => (a -> Bool) -> Fold m a b -> Parser m a b
775+takeStartBy_ :: Monad m => (a -> Bool) -> Fold m a b -> Parser a m b
776takeStartBy_ isBegin = takeFramedByGeneric Nothing (Just isBegin) Nothing
776takeStartBy_ isBegin = takeFramedByGeneric Nothing (Just isBegin) Nothing
778-------------------------------------------------------------------------------
778-------------------------------------------------------------------------------
@@ -786,7 +786,7 @@ takeStartBy_ isBegin = takeFramedByGeneric Nothing (Just isBegin) Nothing
786-- /pre-release/
786-- /pre-release/
787{-# INLINE takeEndByEsc #-}
787{-# INLINE takeEndByEsc #-}
788takeEndByEsc :: Monad m =>
788takeEndByEsc :: Monad m =>
789− (a -> Bool) -> (a -> Bool) -> Parser m a b -> Parser m a b
789+ (a -> Bool) -> (a -> Bool) -> Parser a m b -> Parser a m b
790takeEndByEsc isEsc isEnd p =
790takeEndByEsc isEsc isEnd p =
791 D.toParserK $ D.takeEndByEsc isEsc isEnd (D.fromParserK p)
791 D.toParserK $ D.takeEndByEsc isEsc isEnd (D.fromParserK p)
@@ -813,7 +813,7 @@ takeEndByEsc isEsc isEnd p =
813-- /Pre-release/
813-- /Pre-release/
814{-# INLINE takeFramedByEsc_ #-}
814{-# INLINE takeFramedByEsc_ #-}
815takeFramedByEsc_ :: Monad m =>
815takeFramedByEsc_ :: Monad m =>
816− (a -> Bool) -> (a -> Bool) -> (a -> Bool) -> Fold m a b -> Parser m a b
816+ (a -> Bool) -> (a -> Bool) -> (a -> Bool) -> Fold m a b -> Parser a m b
817takeFramedByEsc_ isEsc isBegin isEnd f =
817takeFramedByEsc_ isEsc isBegin isEnd f =
818 D.toParserK $ D.takeFramedByEsc_ isEsc isBegin isEnd f
818 D.toParserK $ D.takeFramedByEsc_ isEsc isBegin isEnd f
819-- takeEndByEsc_ isEsc isEnd p =
819-- takeEndByEsc_ isEsc isEnd p =
@@ -826,7 +826,7 @@ takeFramedByEsc_ isEsc isBegin isEnd f =
827{-# INLINE takeFramedBy_ #-}
827{-# INLINE takeFramedBy_ #-}
828takeFramedBy_ :: Monad m =>
828takeFramedBy_ :: Monad m =>
829− (a -> Bool) -> (a -> Bool) -> Fold m a b -> Parser m a b
829+ (a -> Bool) -> (a -> Bool) -> Fold m a b -> Parser a m b
830takeFramedBy_ isBegin isEnd f = D.toParserK $ D.takeFramedBy_ isBegin isEnd f
830takeFramedBy_ isBegin isEnd f = D.toParserK $ D.takeFramedBy_ isBegin isEnd f
831-- takeFramedBy_ isBegin isEnd =
831-- takeFramedBy_ isBegin isEnd =
832-- takeFramedByGeneric (Just (const False)) (Just isBegin) (Just isEnd)
832-- takeFramedByGeneric (Just (const False)) (Just isBegin) (Just isEnd)
@@ -855,7 +855,7 @@ takeFramedBy_ isBegin isEnd f = D.toParserK $ D.takeFramedBy_ isBegin isEnd f
857{-# INLINE wordBy #-}
857{-# INLINE wordBy #-}
858−wordBy :: Monad m => (a -> Bool) -> Fold m a b -> Parser m a b
858+wordBy :: Monad m => (a -> Bool) -> Fold m a b -> Parser a m b
859wordBy f = D.toParserK . D.wordBy f
859wordBy f = D.toParserK . D.wordBy f
861-- | Like 'wordBy' but treats anything inside a pair of quotes as a single
861-- | Like 'wordBy' but treats anything inside a pair of quotes as a single
@@ -884,7 +884,7 @@ wordFramedBy :: Monad m =>
884 -> (a -> Bool) -- ^ right quote
884 -> (a -> Bool) -- ^ right quote
885 -> (a -> Bool) -- ^ word seperator
885 -> (a -> Bool) -- ^ word seperator
886 -> Fold m a b
886 -> Fold m a b
887− -> Parser m a b
887+ -> Parser a m b
888wordFramedBy isEsc isBegin isEnd isSpc =
888wordFramedBy isEsc isBegin isEnd isSpc =
889 D.toParserK . D.wordFramedBy isEsc isBegin isEnd isSpc
889 D.toParserK . D.wordFramedBy isEsc isBegin isEnd isSpc
@@ -917,7 +917,7 @@ wordQuotedBy :: (Monad m, Eq a) =>
917 -> (a -> a) -- ^ get right quote from left quote
917 -> (a -> a) -- ^ get right quote from left quote
918 -> (a -> Bool) -- ^ word seperator
918 -> (a -> Bool) -- ^ word seperator
919 -> Fold m a b
919 -> Fold m a b
920− -> Parser m a b
920+ -> Parser a m b
921wordQuotedBy keepQuotes isEsc isBegin isEnd toRight isSpc =
921wordQuotedBy keepQuotes isEsc isBegin isEnd toRight isSpc =
922 D.toParserK . D.wordQuotedBy keepQuotes isEsc isBegin isEnd toRight isSpc
922 D.toParserK . D.wordQuotedBy keepQuotes isEsc isBegin isEnd toRight isSpc
@@ -948,7 +948,7 @@ wordQuotedBy keepQuotes isEsc isBegin isEnd toRight isSpc =
948-- [[3,5,4],[1,2],[0]]
948-- [[3,5,4],[1,2],[0]]
950{-# INLINE groupBy #-}
950{-# INLINE groupBy #-}
951−groupBy :: Monad m => (a -> a -> Bool) -> Fold m a b -> Parser m a b
951+groupBy :: Monad m => (a -> a -> Bool) -> Fold m a b -> Parser a m b
952groupBy eq = D.toParserK . D.groupBy eq
952groupBy eq = D.toParserK . D.groupBy eq
954-- | Unlike 'groupBy' this combinator performs a rolling comparison of two
954-- | Unlike 'groupBy' this combinator performs a rolling comparison of two
@@ -982,7 +982,7 @@ groupBy eq = D.toParserK . D.groupBy eq
982-- /Pre-release/
982-- /Pre-release/
984{-# INLINE groupByRolling #-}
984{-# INLINE groupByRolling #-}
985−groupByRolling :: Monad m => (a -> a -> Bool) -> Fold m a b -> Parser m a b
985+groupByRolling :: Monad m => (a -> a -> Bool) -> Fold m a b -> Parser a m b
986groupByRolling eq = D.toParserK . D.groupByRolling eq
986groupByRolling eq = D.toParserK . D.groupByRolling eq
988-- | Like 'groupByRolling', but if the predicate is 'True' then collects using
988-- | Like 'groupByRolling', but if the predicate is 'True' then collects using
@@ -997,7 +997,7 @@ groupByRolling eq = D.toParserK . D.groupByRolling eq
997-- /Pre-release/
997-- /Pre-release/
998{-# INLINE groupByRollingEither #-}
998{-# INLINE groupByRollingEither #-}
999groupByRollingEither :: Monad m =>
999groupByRollingEither :: Monad m =>
1000− (a -> a -> Bool) -> Fold m a b -> Fold m a c -> Parser m a (Either b c)
1000+ (a -> a -> Bool) -> Fold m a b -> Fold m a c -> Parser a m (Either b c)
1001groupByRollingEither eq f1 = D.toParserK . D.groupByRollingEither eq f1
1001groupByRollingEither eq f1 = D.toParserK . D.groupByRollingEither eq f1
1003-- XXX eqBy is not a good name because we are not matching the entire stream
1003-- XXX eqBy is not a good name because we are not matching the entire stream
@@ -1010,7 +1010,7 @@ groupByRollingEither eq f1 = D.toParserK . D.groupByRollingEither eq f1
1010-- See also: "Streamly.Data.Stream.eqBy"
1010-- See also: "Streamly.Data.Stream.eqBy"
1012{-# INLINE eqBy #-}
1012{-# INLINE eqBy #-}
1013−eqBy :: Monad m => (a -> a -> Bool) -> Stream m a -> Parser m a ()
1013+eqBy :: Monad m => (a -> a -> Bool) -> Stream m a -> Parser a m ()
1014eqBy cmp = D.toParserK . D.eqBy cmp . Stream.toStreamD
1014eqBy cmp = D.toParserK . D.eqBy cmp . Stream.toStreamD
1016-- | Match the given sequence of elements using the given comparison function.
1016-- | Match the given sequence of elements using the given comparison function.
@@ -1029,7 +1029,7 @@ eqBy cmp = D.toParserK . D.eqBy cmp . Stream.toStreamD
1029-- *** Exception: ParseError "eqBy: mismtach occurred"
1029-- *** Exception: ParseError "eqBy: mismtach occurred"
1031{-# INLINE listEqBy #-}
1031{-# INLINE listEqBy #-}
1032−listEqBy :: Monad m => (a -> a -> Bool) -> [a] -> Parser m a [a]
1032+listEqBy :: Monad m => (a -> a -> Bool) -> [a] -> Parser a m [a]
1033-- listEqBy cmp xs = D.toParserK (D.listEqBy cmp xs)
1033-- listEqBy cmp xs = D.toParserK (D.listEqBy cmp xs)
1034listEqBy cmp xs = eqBy cmp (Stream.fromList xs) *> fromPure xs
1034listEqBy cmp xs = eqBy cmp (Stream.fromList xs) *> fromPure xs
@@ -1040,7 +1040,7 @@ listEqBy cmp xs = eqBy cmp (Stream.fromList xs) *> fromPure xs
1040-- >>> listEq = Parser.listEqBy (==)
1040-- >>> listEq = Parser.listEqBy (==)
1042{-# INLINE listEq #-}
1042{-# INLINE listEq #-}
1043−listEq :: (Monad m, Eq a) => [a] -> Parser m a [a]
1043+listEq :: (Monad m, Eq a) => [a] -> Parser a m [a]
1044listEq = listEqBy (==)
1044listEq = listEqBy (==)
1046-- | Match if the input stream is a subsequence of the argument stream i.e. all
1046-- | Match if the input stream is a subsequence of the argument stream i.e. all
@@ -1049,7 +1049,7 @@ listEq = listEqBy (==)
1049-- subsequence of itself.
1049-- subsequence of itself.
1050{-# INLINE subsequenceBy #-}
1050{-# INLINE subsequenceBy #-}
1051subsequenceBy :: -- Monad m =>
1051subsequenceBy :: -- Monad m =>
1052− (a -> a -> Bool) -> Stream m a -> Parser m a ()
1052+ (a -> a -> Bool) -> Stream m a -> Parser a m ()
1053subsequenceBy = undefined
1053subsequenceBy = undefined
@@ -1096,17 +1096,17 @@ regexPCRE = undefined
1096-- primitives. Some common idioms are described below,
1096-- primitives. Some common idioms are described below,
1099−-- span :: (a -> Bool) -> Fold m a b -> Fold m a b -> Parser m a b
1099+-- span :: (a -> Bool) -> Fold m a b -> Fold m a b -> Parser a m b
1100-- span pred f1 f2 = serialWith (,) ('takeWhile' pred f1) ('fromFold' f2)
1100-- span pred f1 f2 = serialWith (,) ('takeWhile' pred f1) ('fromFold' f2)
1104−-- spanBy :: (a -> a -> Bool) -> Fold m a b -> Fold m a b -> Parser m a b
1104+-- spanBy :: (a -> a -> Bool) -> Fold m a b -> Fold m a b -> Parser a m b
1105-- spanBy eq f1 f2 = serialWith (,) ('groupBy' eq f1) ('fromFold' f2)
1105-- spanBy eq f1 f2 = serialWith (,) ('groupBy' eq f1) ('fromFold' f2)
1109−-- spanByRolling :: (a -> a -> Bool) -> Fold m a b -> Fold m a b -> Parser m a b
1109+-- spanByRolling :: (a -> a -> Bool) -> Fold m a b -> Fold m a b -> Parser a m b
1110-- spanByRolling eq f1 f2 = serialWith (,) ('groupByRolling' eq f1) ('fromFold' f2)
1110-- spanByRolling eq f1 f2 = serialWith (,) ('groupByRolling' eq f1) ('fromFold' f2)
@@ -1114,7 +1114,7 @@ regexPCRE = undefined
1115{-# INLINE serialWith #-}
1115{-# INLINE serialWith #-}
1116serialWith :: Monad m
1116serialWith :: Monad m
1117− => (a -> b -> c) -> Parser m x a -> Parser m x b -> Parser m x c
1117+ => (a -> b -> c) -> Parser x m a -> Parser x m b -> Parser x m c
1118serialWith f p1 p2 =
1118serialWith f p1 p2 =
1119 D.toParserK $ D.serialWith f (D.fromParserK p1) (D.fromParserK p2)
1119 D.toParserK $ D.serialWith f (D.fromParserK p1) (D.fromParserK p2)
@@ -1139,7 +1139,7 @@ serialWith f p1 p2 =
1139-- /Pre-release/
1139-- /Pre-release/
1141{-# INLINE split_ #-}
1141{-# INLINE split_ #-}
1142−split_ :: Monad m => Parser m x a -> Parser m x b -> Parser m x b
1142+split_ :: Monad m => Parser x m a -> Parser x m b -> Parser x m b
1143split_ p1 p2 = D.toParserK $ D.split_ (D.fromParserK p1) (D.fromParserK p2)
1143split_ p1 p2 = D.toParserK $ D.split_ (D.fromParserK p1) (D.fromParserK p2)
@@ -1151,7 +1151,7 @@ split_ p1 p2 = D.toParserK $ D.split_ (D.fromParserK p1) (D.fromParserK p2)
1152{-# INLINE teeWith #-}
1152{-# INLINE teeWith #-}
1153teeWith :: Monad m
1153teeWith :: Monad m
1154− => (a -> b -> c) -> Parser m x a -> Parser m x b -> Parser m x c
1154+ => (a -> b -> c) -> Parser x m a -> Parser x m b -> Parser x m c
1155teeWith f p1 p2 =
1155teeWith f p1 p2 =
1156 D.toParserK $ D.teeWith f (D.fromParserK p1) (D.fromParserK p2)
1156 D.toParserK $ D.teeWith f (D.fromParserK p1) (D.fromParserK p2)
@@ -1162,7 +1162,7 @@ teeWith f p1 p2 =
1163{-# INLINE teeWithFst #-}
1163{-# INLINE teeWithFst #-}
1164teeWithFst :: Monad m
1164teeWithFst :: Monad m
1165− => (a -> b -> c) -> Parser m x a -> Parser m x b -> Parser m x c
1165+ => (a -> b -> c) -> Parser x m a -> Parser x m b -> Parser x m c
1166teeWithFst f p1 p2 =
1166teeWithFst f p1 p2 =
1167 D.toParserK $ D.teeWithFst f (D.fromParserK p1) (D.fromParserK p2)
1167 D.toParserK $ D.teeWithFst f (D.fromParserK p1) (D.fromParserK p2)
@@ -1173,7 +1173,7 @@ teeWithFst f p1 p2 =
1174{-# INLINE teeWithMin #-}
1174{-# INLINE teeWithMin #-}
1175teeWithMin :: Monad m
1175teeWithMin :: Monad m
1176− => (a -> b -> c) -> Parser m x a -> Parser m x b -> Parser m x c
1176+ => (a -> b -> c) -> Parser x m a -> Parser x m b -> Parser x m c
1177teeWithMin f p1 p2 =
1177teeWithMin f p1 p2 =
1178 D.toParserK $ D.teeWithMin f (D.fromParserK p1) (D.fromParserK p2)
1178 D.toParserK $ D.teeWithMin f (D.fromParserK p1) (D.fromParserK p2)
@@ -1196,7 +1196,7 @@ teeWithMin f p1 p2 =
1196-- /Pre-release/
1196-- /Pre-release/
1198{-# INLINE alt #-}
1198{-# INLINE alt #-}
1199−alt :: Monad m => Parser m x a -> Parser m x a -> Parser m x a
1199+alt :: Monad m => Parser x m a -> Parser x m a -> Parser x m a
1200alt p1 p2 = D.toParserK $ D.alt (D.fromParserK p1) (D.fromParserK p2)
1200alt p1 p2 = D.toParserK $ D.alt (D.fromParserK p1) (D.fromParserK p2)
@@ -1208,7 +1208,7 @@ alt p1 p2 = D.toParserK $ D.alt (D.fromParserK p1) (D.fromParserK p2)
1209{-# INLINE shortest #-}
1209{-# INLINE shortest #-}
1210shortest :: Monad m
1210shortest :: Monad m
1211− => Parser m x a -> Parser m x a -> Parser m x a
1211+ => Parser x m a -> Parser x m a -> Parser x m a
1212shortest p1 p2 = D.toParserK $ D.shortest (D.fromParserK p1) (D.fromParserK p2)
1212shortest p1 p2 = D.toParserK $ D.shortest (D.fromParserK p1) (D.fromParserK p2)
1214-- | Longest alternative. Apply both parsers in parallel but choose the result
1214-- | Longest alternative. Apply both parsers in parallel but choose the result
@@ -1219,14 +1219,14 @@ shortest p1 p2 = D.toParserK $ D.shortest (D.fromParserK p1) (D.fromParserK p2)
1220{-# INLINE longest #-}
1220{-# INLINE longest #-}
1221longest :: Monad m
1221longest :: Monad m
1222− => Parser m x a -> Parser m x a -> Parser m x a
1222+ => Parser x m a -> Parser x m a -> Parser x m a
1223longest p1 p2 = D.toParserK $ D.longest (D.fromParserK p1) (D.fromParserK p2)
1223longest p1 p2 = D.toParserK $ D.longest (D.fromParserK p1) (D.fromParserK p2)
1226-- | Run a parser without consuming the input.
1226-- | Run a parser without consuming the input.
1228{-# INLINE lookAhead #-}
1228{-# INLINE lookAhead #-}
1229−lookAhead :: Monad m => Parser m a b -> Parser m a b
1229+lookAhead :: Monad m => Parser a m b -> Parser a m b
1230lookAhead p = D.toParserK $ D.lookAhead $ D.fromParserK p
1230lookAhead p = D.toParserK $ D.lookAhead $ D.fromParserK p
1232-- | Takes at-most @n@ input elements.
1232-- | Takes at-most @n@ input elements.
@@ -1242,7 +1242,7 @@ lookAhead p = D.toParserK $ D.lookAhead $ D.fromParserK p
1243-- /Internal/
1243-- /Internal/
1244{-# INLINE takeP #-}
1244{-# INLINE takeP #-}
1245−takeP :: Monad m => Int -> Parser m a b -> Parser m a b
1245+takeP :: Monad m => Int -> Parser a m b -> Parser a m b
1246takeP i p = D.toParserK $ D.takeP i $ D.fromParserK p
1246takeP i p = D.toParserK $ D.takeP i $ D.fromParserK p
1248-------------------------------------------------------------------------------
1248-------------------------------------------------------------------------------
@@ -1261,7 +1261,7 @@ takeP i p = D.toParserK $ D.takeP i $ D.fromParserK p
1261{-# INLINE concatSequence #-}
1261{-# INLINE concatSequence #-}
1262concatSequence ::
1262concatSequence ::
1263 Monad m =>
1263 Monad m =>
1264− Fold m b c -> Stream m (Parser m a b) -> Parser m a c
1264+ Fold m b c -> Stream m (Parser a m b) -> Parser a m c
1265concatSequence f p =
1265concatSequence f p =
1266 let sp = fmap D.fromParserK $ Stream.toStreamD p
1266 let sp = fmap D.fromParserK $ Stream.toStreamD p
1267 in D.toParserK $ D.sequence sp f
1267 in D.toParserK $ D.sequence sp f
@@ -1277,7 +1277,7 @@ concatSequence f p =
1278{-# INLINE concatMap #-}
1278{-# INLINE concatMap #-}
1279concatMap :: Monad m
1279concatMap :: Monad m
1280− => (b -> Parser m a c) -> Parser m a b -> Parser m a c
1280+ => (b -> Parser a m c) -> Parser a m b -> Parser a m c
1281concatMap f p = D.toParserK $ D.concatMap (D.fromParserK . f) (D.fromParserK p)
1281concatMap f p = D.toParserK $ D.concatMap (D.fromParserK . f) (D.fromParserK p)
@@ -1294,7 +1294,7 @@ concatMap f p = D.toParserK $ D.concatMap (D.fromParserK . f) (D.fromParserK p)
1295{-# INLINE choice #-}
1295{-# INLINE choice #-}
1296choice ::
1296choice ::
1297− (Functor t, Foldable t, Monad m) => t (Parser m a b) -> Parser m a b
1297+ (Functor t, Foldable t, Monad m) => t (Parser a m b) -> Parser a m b
1298choice ps = D.toParserK $ D.choice $ D.fromParserK <$> ps
1298choice ps = D.toParserK $ D.choice $ D.fromParserK <$> ps
@@ -1309,7 +1309,7 @@ choice ps = D.toParserK $ D.choice $ D.fromParserK <$> ps
1310{-# INLINE manyP #-}
1310{-# INLINE manyP #-}
1311manyP :: -- Monad m =>
1311manyP :: -- Monad m =>
1312− Parser m a b -> Parser m b c -> Parser m a c
1312+ Parser a m b -> Parser b m c -> Parser a m c
1313manyP _p _f = undefined -- D.toParserK $ D.manyP (D.fromParserK p) f
1313manyP _p _f = undefined -- D.toParserK $ D.manyP (D.fromParserK p) f
1315-- | Collect zero or more parses. Apply the supplied parser repeatedly on the
1315-- | Collect zero or more parses. Apply the supplied parser repeatedly on the
@@ -1323,7 +1323,7 @@ manyP _p _f = undefined -- D.toParserK $ D.manyP (D.fromParserK p) f
1323-- Compare with 'Control.Applicative.many'.
1323-- Compare with 'Control.Applicative.many'.
1325{-# INLINE many #-}
1325{-# INLINE many #-}
1326−many :: Monad m => Parser m a b -> Fold m b c -> Parser m a c
1326+many :: Monad m => Parser a m b -> Fold m b c -> Parser a m c
1327many p f = D.toParserK $ D.many (D.fromParserK p) f
1327many p f = D.toParserK $ D.many (D.fromParserK p) f
1329-- Note: many1 would perhaps be a better name for this and consistent with
1329-- Note: many1 would perhaps be a better name for this and consistent with
@@ -1342,7 +1342,7 @@ many p f = D.toParserK $ D.many (D.fromParserK p) f
1342-- Compare with 'Control.Applicative.some'.
1342-- Compare with 'Control.Applicative.some'.
1344{-# INLINE some #-}
1344{-# INLINE some #-}
1345−some :: Monad m => Parser m a b -> Fold m b c -> Parser m a c
1345+some :: Monad m => Parser a m b -> Fold m b c -> Parser a m c
1346some p f = D.toParserK $ D.some (D.fromParserK p) f
1346some p f = D.toParserK $ D.some (D.fromParserK p) f
1347-- some p f = manyP p (takeGE 1 f)
1347-- some p f = manyP p (takeGE 1 f)
1348-- some = countBetween 1 maxBound
1348-- some = countBetween 1 maxBound
@@ -1357,7 +1357,7 @@ some p f = D.toParserK $ D.some (D.fromParserK p) f
1358{-# INLINE countBetween #-}
1358{-# INLINE countBetween #-}
1359countBetween :: -- Monad m =>
1359countBetween :: -- Monad m =>
1360− Int -> Int -> Parser m a b -> Fold m b c -> Parser m a c
1360+ Int -> Int -> Parser a m b -> Fold m b c -> Parser a m c
1361countBetween _m _n _p = undefined
1361countBetween _m _n _p = undefined
1362-- countBetween m n p f = manyP p (takeBetween m n f)
1362-- countBetween m n p f = manyP p (takeBetween m n f)
@@ -1372,7 +1372,7 @@ countBetween _m _n _p = undefined
1373{-# INLINE count #-}
1373{-# INLINE count #-}
1374count :: -- Monad m =>
1374count :: -- Monad m =>
1375− Int -> Parser m a b -> Fold m b c -> Parser m a c
1375+ Int -> Parser a m b -> Fold m b c -> Parser a m c
1376count n = countBetween n n
1376count n = countBetween n n
1377-- count n p f = manyP p (takeEQ n f)
1377-- count n p f = manyP p (takeEQ n f)
@@ -1389,7 +1389,7 @@ count n = countBetween n n
1390{-# INLINE manyTillP #-}
1390{-# INLINE manyTillP #-}
1391manyTillP :: -- Monad m =>
1391manyTillP :: -- Monad m =>
1392− Parser m a b -> Parser m a x -> Parser m b c -> Parser m a c
1392+ Parser a m b -> Parser a m x -> Parser b m c -> Parser a m c
1393manyTillP _p1 _p2 _f = undefined
1393manyTillP _p1 _p2 _f = undefined
1394 -- D.toParserK $ D.manyTillP (D.fromParserK p1) (D.fromParserK p2) f
1394 -- D.toParserK $ D.manyTillP (D.fromParserK p1) (D.fromParserK p2) f
@@ -1403,11 +1403,11 @@ manyTillP _p1 _p2 _f = undefined
1404{-# INLINE manyTill #-}
1404{-# INLINE manyTill #-}
1405manyTill :: Monad m
1405manyTill :: Monad m
1406− => Parser m a b -- ^ Chunking parser. Parses chunks of input.
1406+ => Parser a m b -- ^ Chunking parser. Parses chunks of input.
1407− -> Parser m a x -- ^ Test parser. Parsing stops when this parser succeeds
1407+ -> Parser a m x -- ^ Test parser. Parsing stops when this parser succeeds
1408 -- else backtract and run the chunking parser.
1408 -- else backtract and run the chunking parser.
1409 -> Fold m b c -- ^ Folds the output of the chunking parser.
1409 -> Fold m b c -- ^ Folds the output of the chunking parser.
1410− -> Parser m a c
1410+ -> Parser a m c
1411manyTill collect test f =
1411manyTill collect test f =
1412 D.toParserK $ D.manyTill (D.fromParserK collect) (D.fromParserK test) f
1412 D.toParserK $ D.manyTill (D.fromParserK collect) (D.fromParserK test) f
@@ -1423,7 +1423,7 @@ manyTill collect test f =
1424{-# INLINE manyThen #-}
1424{-# INLINE manyThen #-}
1425manyThen :: -- (Foldable t, Monad m) =>
1425manyThen :: -- (Foldable t, Monad m) =>
1426− Parser m a b -> Parser m a x -> Fold m b c -> Parser m a c
1426+ Parser a m b -> Parser a m x -> Fold m b c -> Parser a m c
1427manyThen _parser _recover _f = undefined
1427manyThen _parser _recover _f = undefined
1429-------------------------------------------------------------------------------
1429-------------------------------------------------------------------------------
@@ -1453,10 +1453,10 @@ manyThen _parser _recover _f = undefined
1454{-# INLINE deintercalate #-}
1454{-# INLINE deintercalate #-}
1455deintercalate :: Monad m =>
1455deintercalate :: Monad m =>
1456− Parser m a x
1456+ Parser a m x
1457− -> Parser m a y
1457+ -> Parser a m y
1458 -> Fold m (Either x y) z
1458 -> Fold m (Either x y) z
1459− -> Parser m a z
1459+ -> Parser a m z
1460deintercalate contentL contentR sink =
1460deintercalate contentL contentR sink =
1461 D.toParserK
1461 D.toParserK
1462 $ D.deintercalate
1462 $ D.deintercalate
@@ -1470,7 +1470,7 @@ deintercalate contentL contentR sink =
1471{-# INLINE sepBy1 #-}
1471{-# INLINE sepBy1 #-}
1472sepBy1 :: Monad m =>
1472sepBy1 :: Monad m =>
1473− Parser m a b -> Parser m a x -> Fold m b c -> Parser m a c
1473+ Parser a m b -> Parser a m x -> Fold m b c -> Parser a m c
1474sepBy1 p sep sink = do
1474sepBy1 p sep sink = do
1476 f <- fromEffect $ FL.reduce sink
1476 f <- fromEffect $ FL.reduce sink
@@ -1486,7 +1486,7 @@ sepBy1 p sep sink = do
1487{-# INLINE sepBy #-}
1487{-# INLINE sepBy #-}
1488sepBy :: Monad m =>
1488sepBy :: Monad m =>
1489− Parser m a b -> Parser m a x -> Fold m b c -> Parser m a c
1489+ Parser a m b -> Parser a m x -> Fold m b c -> Parser a m c
1490sepBy content sep sink =
1490sepBy content sep sink =
1491 D.toParserK $ D.sepBy (D.fromParserK content) (D.fromParserK sep) sink
1491 D.toParserK $ D.sepBy (D.fromParserK content) (D.fromParserK sep) sink
1492-- sepBy sink = deintercalate (FL.lefts sink)
1492-- sepBy sink = deintercalate (FL.lefts sink)
@@ -1503,7 +1503,7 @@ sepBy content sep sink =
1504{-# INLINE roundRobin #-}
1504{-# INLINE roundRobin #-}
1505roundRobin :: -- (Foldable t, Monad m) =>
1505roundRobin :: -- (Foldable t, Monad m) =>
1506− t (Parser m a b) -> Fold m b c -> Parser m a c
1506+ t (Parser a m b) -> Fold m b c -> Parser a m c
1507roundRobin _ps _f = undefined
1507roundRobin _ps _f = undefined
1509-------------------------------------------------------------------------------
1509-------------------------------------------------------------------------------
@@ -1518,7 +1518,7 @@ roundRobin _ps _f = undefined
1519{-# INLINE retryMaxTotal #-}
1519{-# INLINE retryMaxTotal #-}
1520retryMaxTotal :: -- (Monad m) =>
1520retryMaxTotal :: -- (Monad m) =>
1521− Int -> Parser m a b -> Fold m b c -> Parser m a c
1521+ Int -> Parser a m b -> Fold m b c -> Parser a m c
1522retryMaxTotal _n _p _f = undefined
1522retryMaxTotal _n _p _f = undefined
1524-- | Like 'retryMaxTotal' but aborts after @n@ successive failures.
1524-- | Like 'retryMaxTotal' but aborts after @n@ successive failures.
@@ -1527,7 +1527,7 @@ retryMaxTotal _n _p _f = undefined
1528{-# INLINE retryMaxSuccessive #-}
1528{-# INLINE retryMaxSuccessive #-}
1529retryMaxSuccessive :: -- (Monad m) =>
1529retryMaxSuccessive :: -- (Monad m) =>
1530− Int -> Parser m a b -> Fold m b c -> Parser m a c
1530+ Int -> Parser a m b -> Fold m b c -> Parser a m c
1531retryMaxSuccessive _n _p _f = undefined
1531retryMaxSuccessive _n _p _f = undefined
1533-- | Keep trying a parser until it succeeds. When the parser fails the input
1533-- | Keep trying a parser until it succeeds. When the parser fails the input
@@ -1538,5 +1538,5 @@ retryMaxSuccessive _n _p _f = undefined
1539{-# INLINE retry #-}
1539{-# INLINE retry #-}
1540retry :: -- (Monad m) =>
1540retry :: -- (Monad m) =>
1541− Parser m a b -> Parser m a b
1541+ Parser a m b -> Parser a m b
1542retry _p = undefined
1542retry _p = undefined