@@ -22,6 +22,7 @@ module Streamly.Internal.Data.Parser.ParserK.Types
2222 (
2323 Parser (..)
2424 , yield
25+ , yieldM
2526 , die
2627
2728 -- * Conversion
@@ -278,6 +279,14 @@ instance Functor m => Functor (Parser m a) where
278279yield :: b -> Parser m a b
279280yield b = MkParser $ \lo st yieldk -> yieldk st (Done lo b)
280281
282+-- | See 'Streamly.Internal.Data.Parser.yieldM'.
283+--
284+-- /Internal/
285+--
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)
289+
281290-- | 'Applicative' form of 'Streamly.Internal.Data.Parser.splitWith'. Note that
282291-- this operation does not fuse, use 'Streamly.Internal.Data.Parser.splitWith'
283292-- when fusion is important.