@@ -126,16 +126,16 @@ each = Prelude.foldr cons nil
126126-- | Iterate a pure function from a seed value, streaming the results forever
127127iterate :: Streaming t => (a -> a) -> a -> t m a
128128iterate step = fromStream . go
129− where
130− go s = scons s (Just (go (step s)))
129+ where
130+ go s = scons s (Just (go (step s)))
131131
132132-- | Iterate a monadic function from a seed value, streaming the results forever
133−iterateM :: (Streaming t, Monad m) => (a -> m a) -> m a -> t m a
133+iterateM :: (Streaming t, Monad m) => (a -> m a) -> a -> t m a
134134iterateM step = fromStream . go
135− where
136− go ms = Stream $ \_ _ yld -> do
137− s <- ms
138− yld s (Just (go (step s)))
135+ where
136+ go s = Stream $ \_ _ yld -> do
137+ a <- step s
138+ yld s (Just (go a))
139139
140140-- | Read lines from an IO Handle into a stream of Strings.
141141fromHandle :: (Streaming t, MonadIO m) => IO.Handle -> t m String