@@ -340,7 +340,7 @@ head m =
340tail :: (Streaming t, Monad m) => t m a -> m (Maybe (t m a))
340tail :: (Streaming t, Monad m) => t m a -> m (Maybe (t m a))
342 let stop = return Nothing
342 let stop = return Nothing
343− yield _ Nothing = return $ Just nil
343+ yield _ Nothing = return Nothing
344 yield _ (Just t) = return $ Just $ fromStream t
344 yield _ (Just t) = return $ Just $ fromStream t
345 in (runStream (toStream m)) Nothing stop yield
345 in (runStream (toStream m)) Nothing stop yield
@@ -385,14 +385,13 @@ length = foldl (\n _ -> n + 1) 0 id
385reverse :: (Streaming t) => t m a -> t m a
385reverse :: (Streaming t) => t m a -> t m a
386reverse m = fromStream $ go Nothing (toStream m)
386reverse m = fromStream $ go Nothing (toStream m)
388− go rev rest = Stream $ \s stp yld ->
388+ go rev rest = Stream $ \svr stp yld ->
390− stop = case rev of
389+ let stop = case rev of
391− Nothing -> runStream snil s stp yld
390+ Nothing -> stp
392− Just str -> runStream str s stp yld
391+ Just str -> runStream str svr stp yld
393− yield a Nothing = runStream (a `scons` rev) s stp yld
392+ yield a Nothing = runStream (a `scons` rev) svr stp yld
394− yield a (Just x) = runStream (go (Just $ a `scons` rev) x) s stp yld
393+ yield a (Just x) = runStream (go (Just $ a `scons` rev) x) svr stp yld
395− in runStream rest Nothing stop yield
394+ in runStream rest svr stop yield
397-- XXX replace the recursive "go" with continuation
396-- XXX replace the recursive "go" with continuation
398-- | Determine the minimum element in a stream.
397-- | Determine the minimum element in a stream.