Fix a bug in ParserK yield operation
We should not increment the leftover count.
commitfbb1c8492e9d9df95bf9367a8eaee6849276fbb9
authorHarendra Kumar <harendra@composewell.com>
dateWed 2 Sep 2020, 09:08 (6 years ago)
parenteff3255
src/Streamly/Internal/Data/Parser/ParserK/Types.hs+1−1
@@ -275,7 +275,7 @@ instance Functor m => Functor (Parser m a) where
275275--
276276{-# INLINE yield #-}
277277yield :: b -> Parser m a b
278−yield b = MkParser (\lo st yieldk -> yieldk st (Done (lo + 1) b))
278+yield b = MkParser $ \lo st yieldk -> yieldk st (Done lo b)
279279
280280-- | 'Applicative' form of 'Streamly.Internal.Data.Parser.splitWith'. Note that
281281-- this operation does not fuse, use 'Streamly.Internal.Data.Parser.splitWith'