on cfafcff help sign in
streamly/examples/echo-loop.hs
16 lines 352 B history raw
1import Control.Monad.IO.Class (liftIO)
2import Streamly
4input :: StreamT IO String
5input = do
6 string <- liftIO getLine
7 return string <> input
9output :: StreamT IO String -> StreamT IO ()
10output strings = do
11 s <- strings
12 liftIO $ putStrLn s
14main = do
15 putStrLn "Type something and press enter, repeat"
16 runStreamT $ output input