Re[2]: [Haskell] line-based interactive program

2005-07-09 Thread Bulat Ziganshin
Hello Wolfgang, Saturday, July 09, 2005, 7:01:06 PM, you wrote: >> > As part of my diploma thesis, I'm working on a small collection of modules >> > which provides safe I/O interleaving. The key point is to split the state >> > of the world since I/O on different parts of the world can be interl

Re[2]: [Haskell] line-based interactive program

2005-07-09 Thread Bulat Ziganshin
Hello Wolfgang, Friday, July 08, 2005, 11:55:48 PM, you wrote: WJ> As part of my diploma thesis, I'm working on a small collection of modules WJ> which provides safe I/O interleaving. The key point is to split the state of WJ> the world since I/O on different parts of the world can be interle

Re[2]: [Haskell] line-based interactive program

2005-07-09 Thread Bulat Ziganshin
Hello Andrew, Friday, July 08, 2005, 8:43:02 PM, you wrote: AP> It is one thing to embrace lazy evaluation order, and another to embrace AP> lazy IO (implemented using unsafeInterleaveIO). As a relative newcomer AP> to Haskell, I got the impression that the "interact" style was always a AP> hack,

Re[2]: [Haskell] line-based interactive program

2005-07-07 Thread Bulat Ziganshin
Hello Christian, Thursday, July 07, 2005, 6:55:13 PM, you wrote: CM> Could you also insert a prompt that is shown before the lines are read? CM> (The first prompt seems to be tricky assuming line buffering ) import System.IO main = do hSetBuffering stdin LineBuffering hSetBuffering stdout

Re[2]: [Haskell] line-based interactive program

2005-07-07 Thread Bulat Ziganshin
Hello Colin, Thursday, July 07, 2005, 4:33:39 PM, you wrote: >>>type FilterProgram = [Line] -> [Line] CR> interact :: (String -> String) -> IO () and there is lines and unlines functions to do just what yopu need example: main = interact (unlines.filter(not.null).lines) -- Best regards,