rbr-0.8.6: src/Lib/Util.hs
module Lib.Util where
import System.IO
interactl :: String -> (String -> String) -> IO ()
interactl p f = do
putStr p
hFlush stdout
ls <- getContents
i' p f (lines ls)
i' :: String -> (t -> String) -> [t] -> IO ()
i' _ _ [] = return ()
i' p f (l:ls) = do
putStr (f l)
putStr p
hFlush stdout
i' p f ls