@@ -122,10 +122,12 @@ unfoldrM step = fromStream . go
122122each :: (Streaming t, Foldable f) => f a -> t m a
123123each = Prelude.foldr cons nil
124124
125+-- | Iterate a pure function from a seed value, streaming the results forever
125126iterate :: Streaming t => (a -> a) -> a -> t m a
126−iterate f = fromStream . go
127+iterate step = fromStream . go
127128 where
128− go s = scons s (Just (go (f s)))
129+ go s = scons s (Just (go (step s)))
130+
129131
130132-- | Read lines from an IO Handle into a stream of Strings.
131133fromHandle :: (Streaming t, MonadIO m) => IO.Handle -> t m String