@@ -183,7 +183,7 @@ module Streamly.Internal.Data.Parser.ParserD.Type
184 , fromPure
184 , fromPure
185 , fromEffect
185 , fromEffect
186− , serialWith
186+ , splitWith
@@ -671,9 +671,9 @@ fromEffect b = Parser undefined (IDone <$> b) undefined
671{-# ANN type SeqParseState Fuse #-}
671{-# ANN type SeqParseState Fuse #-}
672data SeqParseState sl f sr = SeqParseL sl | SeqParseR f sr
672data SeqParseState sl f sr = SeqParseL sl | SeqParseR f sr
674−-- | See 'Streamly.Internal.Data.Parser.serialWith'.
674+-- | See 'Streamly.Internal.Data.Parser.splitWith'.
676−-- Note: this implementation of serialWith is fast because of stream fusion but
676+-- Note: this implementation of splitWith is fast because of stream fusion but
677-- has quadratic time complexity, because each composition adds a new branch
677-- has quadratic time complexity, because each composition adds a new branch
678-- that each subsequent parse's input element has to go through, therefore, it
678-- that each subsequent parse's input element has to go through, therefore, it
679-- cannot scale to a large number of compositions. After around 100
679-- cannot scale to a large number of compositions. After around 100
@@ -682,10 +682,10 @@ data SeqParseState sl f sr = SeqParseL sl | SeqParseR f sr
683-- /Pre-release/
683-- /Pre-release/
685−{-# INLINE serialWith #-}
685+{-# INLINE splitWith #-}
686−serialWith :: Monad m
686+splitWith :: Monad m
687 => (a -> b -> c) -> Parser x m a -> Parser x m b -> Parser x m c
687 => (a -> b -> c) -> Parser x m a -> Parser x m b -> Parser x m c
688−serialWith func (Parser stepL initialL extractL)
688+splitWith func (Parser stepL initialL extractL)
689 (Parser stepR initialR extractR) =
689 (Parser stepR initialR extractR) =
690 Parser step initial extract
690 Parser step initial extract
@@ -748,7 +748,7 @@ serialWith func (Parser stepL initialL extractL)
748 IDone bR -> return $ Done n $ func bL bR
748 IDone bR -> return $ Done n $ func bL bR
749 IError err -> return $ Error err
749 IError err -> return $ Error err
750 Error err -> return $ Error err
750 Error err -> return $ Error err
751− Partial _ _ -> error "Bug: serialWith extract 'Partial'"
751+ Partial _ _ -> error "Bug: splitWith extract 'Partial'"
752 Continue n s -> return $ Continue n (SeqParseL s)
752 Continue n s -> return $ Continue n (SeqParseL s)
754-------------------------------------------------------------------------------
754-------------------------------------------------------------------------------
@@ -827,7 +827,7 @@ noErrorUnsafeSplitWith func (Parser stepL initialL extractL)
827{-# ANN type SeqAState Fuse #-}
827{-# ANN type SeqAState Fuse #-}
828data SeqAState sl sr = SeqAL sl | SeqAR sr
828data SeqAState sl sr = SeqAL sl | SeqAR sr
830−-- This turns out to be slightly faster than serialWith
830+-- This turns out to be slightly faster than splitWith
831-- | See 'Streamly.Internal.Data.Parser.split_'.
831-- | See 'Streamly.Internal.Data.Parser.split_'.
833-- /Pre-release/
833-- /Pre-release/
@@ -940,13 +940,13 @@ noErrorUnsafeSplit_
940 Partial _ _ -> error "split_: Partial"
940 Partial _ _ -> error "split_: Partial"
941 Continue n s -> return $ Continue n (SeqAL s)
941 Continue n s -> return $ Continue n (SeqAL s)
943−-- | 'Applicative' form of 'serialWith'.
943+-- | 'Applicative' form of 'splitWith'.
944instance Monad m => Applicative (Parser a m) where
944instance Monad m => Applicative (Parser a m) where
945 {-# INLINE pure #-}
945 {-# INLINE pure #-}
946 pure = fromPure
946 pure = fromPure
948 {-# INLINE (<*>) #-}
948 {-# INLINE (<*>) #-}
949− (<*>) = serialWith id
949+ (<*>) = splitWith id
951 {-# INLINE (*>) #-}
951 {-# INLINE (*>) #-}
952 (*>) = split_
952 (*>) = split_