Skip to the content.

The problem

replicateM :: Monad m => Int -> m a -> m [a]
mapM :: Monad m => (a -> m b) -> [a] -> m [b]
sequence :: Monad m => [m a] -> m [a]
main = do
    xs <- sequence . repeat $ getLine
    mapM_ putStrLn xs
    -- 期待通りに動かない例

History

io-streams

Pipes

Conduit

Conduits were created for the Yesod web framework. My understanding is that they were designed to be blazingly fast. Early versions of the library were highly stateful.

Pipes focus on elegance. They have just one type instead of several, form monad (transformer) and category instances, and are very “functional” in design.

出典: http://stackoverflow.com/questions/9983840/what-are-the-pros-and-cons-of-enumerators-vs-conduits-vs-pipes

Machines

Arrow based

Others