@@ -22,6 +22,7 @@ module Streamly.Internal.Data.Parser.ParserK.Types
23 Parser (..)
23 Parser (..)
27 -- * Conversion
28 -- * Conversion
@@ -278,6 +279,14 @@ instance Functor m => Functor (Parser m a) where
278yield :: b -> Parser m a b
279yield :: b -> Parser m a b
279yield b = MkParser $ \lo st yieldk -> yieldk st (Done lo b)
280yield b = MkParser $ \lo st yieldk -> yieldk st (Done lo b)
282+-- | See 'Streamly.Internal.Data.Parser.yieldM'.
286+{-# INLINE yieldM #-}
287+yieldM :: Monad m => m b -> Parser m a b
288+yieldM eff = MkParser $ \lo st yieldk -> eff >>= \b -> yieldk st (Done lo b)
281-- | 'Applicative' form of 'Streamly.Internal.Data.Parser.splitWith'. Note that
290-- | 'Applicative' form of 'Streamly.Internal.Data.Parser.splitWith'. Note that
282-- this operation does not fuse, use 'Streamly.Internal.Data.Parser.splitWith'
291-- this operation does not fuse, use 'Streamly.Internal.Data.Parser.splitWith'
283-- when fusion is important.
292-- when fusion is important.