消费者
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)