@@ -750,10 +750,12 @@ mapMaybe f = go
750750-- | Zip two streams serially using a pure zipping function.
751751--
752752-- @since 0.1.0
753−{-# INLINABLE zipWith #-}
753+{-# INLINE zipWith #-}
754754zipWith :: (a -> b -> c) -> Stream m a -> Stream m b -> Stream m c
755755zipWith f = go
756+
756757 where
758+
757759 go mx my = mkStream $ \st yld sng stp -> do
758760 let merge a ra =
759761 let single2 b = sng (f a b)
@@ -766,16 +768,17 @@ zipWith f = go
766768-- | Zip two streams serially using a monadic zipping function.
767769--
768770-- @since 0.1.0
769−{-# INLINABLE zipWithM #-}
771+{-# INLINE zipWithM #-}
770772zipWithM :: Monad m =>
771773 (a -> b -> m c) -> Stream m a -> Stream m b -> Stream m c
772774zipWithM f = go
775+
773776 where
777+
774778 go mx my = mkStream $ \st yld sng stp -> do
775779 let merge a ra =
776− let runIt x = foldStream st yld sng stp x
777− single2 b = f a b >>= sng
778− yield2 b rb = f a b >>= \x -> runIt (x `cons` go ra rb)
780+ let single2 b = f a b >>= sng
781+ yield2 b rb = f a b >>= \x -> yld x (go ra rb)
779782 in foldStream (adaptState st) yield2 single2 stp my
780783 let single1 a = merge a nil
781784 yield1 = merge