@@ -22,7 +22,7 @@ module Asyncly.AsyncT
2222 , MonadAsync
2323 , runAsyncly
2424 , toList
25− , next
25+ , uncons
2626 , async
2727
2828 , take
@@ -703,8 +703,11 @@ toList m = (runAsyncT m) Nothing stop yield
703703 yield a Nothing = return [a]
704704 yield a (Just x) = liftM (a :) (toList x)
705705
706−next :: MonadAsync m => AsyncT m a -> m (Maybe (a, AsyncT m a))
707−next m = (runAsyncT m) Nothing stop yield
706+-- | Decompose a stream into its head and tail. If the stream is empty, returns
707+-- 'Nothing'. If the stream is non-empty, returns 'Just (a, ma)', where 'a' is
708+-- the head of the stream and 'ma' its tail.
709+uncons :: MonadAsync m => AsyncT m a -> m (Maybe (a, AsyncT m a))
710+uncons m = (runAsyncT m) Nothing stop yield
708711
709712 where
710713