@@ -2159,7 +2159,7 @@ groupByRollingEither
21592159--
21602160{-# INLINE listEqBy #-}
21612161listEqBy :: Monad m => (a -> a -> Bool) -> [a] -> Parser a m [a]
2162−listEqBy cmp xs = streamEqBy cmp (D.fromList xs) *> fromPure xs
2162+listEqBy cmp xs = streamEqByInternal cmp (D.fromList xs) *> fromPure xs
21632163{-
21642164listEqBy cmp str = Parser step initial extract
21652165
@@ -2189,14 +2189,9 @@ listEqBy cmp str = Parser step initial extract
21892189 ++ show (length xs) ++ " elements"
21902190-}
21912191
2192−-- | Like 'listEqBy' but uses a stream instead of a list and does not return
2193−-- the stream.
2194−--
2195−-- See also: "Streamly.Data.Stream.streamEqBy"
2196−--
2197−{-# INLINE streamEqBy #-}
2198−streamEqBy :: Monad m => (a -> a -> Bool) -> D.Stream m a -> Parser a m ()
2199−streamEqBy cmp (D.Stream sstep state) = Parser step initial extract
2192+{-# INLINE streamEqByInternal #-}
2193+streamEqByInternal :: Monad m => (a -> a -> Bool) -> D.Stream m a -> Parser a m ()
2194+streamEqByInternal cmp (D.Stream sstep state) = Parser step initial extract
22002195
22012196 where
22022197
@@ -2231,6 +2226,15 @@ streamEqBy cmp (D.Stream sstep state) = Parser step initial extract
22312226
22322227 extract _ = return $ Error "streamEqBy: end of input"
22332228
2229+-- | Like 'listEqBy' but uses a stream instead of a list and does not return
2230+-- the stream.
2231+--
2232+{-# INLINE streamEqBy #-}
2233+streamEqBy :: Monad m => (a -> a -> Bool) -> D.Stream m a -> Parser a m ()
2234+-- XXX Somehow composing this with "*>" is much faster on the microbenchmark.
2235+-- Need to investigate why.
2236+streamEqBy cmp stream = streamEqByInternal cmp stream *> fromPure ()
2237+
22342238-- Rename to "list".
22352239-- | Match the input sequence with the supplied list and return it if
22362240-- successful.