@@ -306,19 +306,7 @@ runStream (Stream step state) = go SPEC state
307{-# INLINE_NORMAL last #-}
307{-# INLINE_NORMAL last #-}
308last :: Monad m => Stream m a -> m (Maybe a)
308last :: Monad m => Stream m a -> m (Maybe a)
309−last (Stream step state) = go0 SPEC state
309+last = foldl' (\_ y -> Just y) Nothing
314− Yield x s -> go1 SPEC x s
315− Stop -> return Nothing
320− Yield y s -> go1 SPEC y s
321− Stop -> return (Just x)
323------------------------------------------------------------------------------
311------------------------------------------------------------------------------
324-- Map and Fold
312-- Map and Fold