@@ -118,7 +118,7 @@ module Streamly.Internal.Data.Parser.ParserD.Types
121− , splitWith
121+ , serialWith
@@ -325,9 +325,9 @@ yieldM b = Parser undefined (IDone <$> b) undefined
325{-# ANN type SeqParseState Fuse #-}
325{-# ANN type SeqParseState Fuse #-}
326data SeqParseState sl f sr = SeqParseL sl | SeqParseR f sr
326data SeqParseState sl f sr = SeqParseL sl | SeqParseR f sr
328−-- | See 'Streamly.Internal.Data.Parser.splitWith'.
328+-- | See 'Streamly.Internal.Data.Parser.serialWith'.
330−-- Note: this implementation of splitWith is fast because of stream fusion but
330+-- Note: this implementation of serialWith is fast because of stream fusion but
331-- has quadratic time complexity, because each composition adds a new branch
331-- has quadratic time complexity, because each composition adds a new branch
332-- that each subsequent parse's input element has to go through, therefore, it
332-- that each subsequent parse's input element has to go through, therefore, it
333-- cannot scale to a large number of compositions. After around 100
333-- cannot scale to a large number of compositions. After around 100
@@ -336,10 +336,10 @@ data SeqParseState sl f sr = SeqParseL sl | SeqParseR f sr
337-- /Pre-release/
337-- /Pre-release/
339−{-# INLINE splitWith #-}
339+{-# INLINE serialWith #-}
340−splitWith :: MonadThrow m
340+serialWith :: MonadThrow m
341 => (a -> b -> c) -> Parser m x a -> Parser m x b -> Parser m x c
341 => (a -> b -> c) -> Parser m x a -> Parser m x b -> Parser m x c
342−splitWith func (Parser stepL initialL extractL)
342+serialWith func (Parser stepL initialL extractL)
343 (Parser stepR initialR extractR) =
343 (Parser stepR initialR extractR) =
344 Parser step initial extract
344 Parser step initial extract
@@ -457,7 +457,7 @@ noErrorUnsafeSplitWith func (Parser stepL initialL extractL)
457{-# ANN type SeqAState Fuse #-}
457{-# ANN type SeqAState Fuse #-}
458data SeqAState sl sr = SeqAL sl | SeqAR sr
458data SeqAState sl sr = SeqAL sl | SeqAR sr
460−-- This turns out to be slightly faster than splitWith
460+-- This turns out to be slightly faster than serialWith
461-- | See 'Streamly.Internal.Data.Parser.split_'.
461-- | See 'Streamly.Internal.Data.Parser.split_'.
463-- /Pre-release/
463-- /Pre-release/
@@ -513,13 +513,13 @@ split_ (Parser stepL initialL extractL) (Parser stepR initialR extractR) =
513 IDone rR -> return rR
513 IDone rR -> return rR
514 IError err -> throwM $ ParseError err
514 IError err -> throwM $ ParseError err
516−-- | 'Applicative' form of 'splitWith'.
516+-- | 'Applicative' form of 'serialWith'.
517instance MonadThrow m => Applicative (Parser m a) where
517instance MonadThrow m => Applicative (Parser m a) where
518 {-# INLINE pure #-}
518 {-# INLINE pure #-}
519 pure = yield
519 pure = yield
521 {-# INLINE (<*>) #-}
521 {-# INLINE (<*>) #-}
522− (<*>) = splitWith id
522+ (<*>) = serialWith id
524 {-# INLINE (*>) #-}
524 {-# INLINE (*>) #-}
525 (*>) = split_
525 (*>) = split_