@@ -216,10 +216,6 @@ take n m = fromStream $ go n (toStream m)
216216 yield a (Just x) = yld a (Just (go (n1 - 1) x))
217217 in if n1 <= 0 then stp else (runStream m1) ctx stp yield
218218
219−-- XXX This is not as efficient as it could be. We need a short circuiting at
220−-- a lower level. Compare with simple-conduit, filtering there cuts down time
221−-- due to short circuting whereas the time spent remains the same here.
222−
223219-- | Include only those elements that pass a predicate.
224220{-# INLINE filter #-}
225221filter :: Streaming t => (a -> Bool) -> t m a -> t m a
@@ -256,13 +252,14 @@ drop n m = fromStream $ go n (toStream m)
256252
257253-- | Drop elements in the stream as long as the predicate succeeds and then
258254-- take the rest of the stream.
255+{-# INLINE dropWhile #-}
259256dropWhile :: Streaming t => (a -> Bool) -> t m a -> t m a
260257dropWhile p m = fromStream $ go (toStream m)
261258 where
262259 go m1 = Stream $ \ctx stp yld ->
263260 let yield a Nothing | p a = stp
264261 | otherwise = yld a Nothing
265− yield a (Just x) | p a = (runStream (go x)) ctx stp yield
262+ yield a (Just x) | p a = (runStream x) ctx stp yield
266263 | otherwise = yld a (Just x)
267264 in (runStream m1) ctx stp yield
268265