消費者
Consumer
只能從上游獲得值。
type Consumer a = Proxy () a () X
await::Monad m => Consumer a m a
例如:
fancyPrint::MonadIO m => Consumer String m ()
fancyPrint = forever $ do
numStr <- await
liftIO $ putStrLn ("I received: " ++ numStr)
Consumer
只能從上游獲得值。
type Consumer a = Proxy () a () X
await::Monad m => Consumer a m a
例如:
fancyPrint::MonadIO m => Consumer String m ()
fancyPrint = forever $ do
numStr <- await
liftIO $ putStrLn ("I received: " ++ numStr)