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: [Haskell] line-based interactive program

2005-07-07 Thread Christian Maeder
Bulat Ziganshin wrote: > 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

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,

Re: [Haskell] line-based interactive program

2005-07-07 Thread Colin Runciman
Christian Maeder wrote: -- a filter program process an entire input to yield some output type FilterProgram = [Line] -> [Line] Forget this, if it's not an (old) exercise Yes, people don't write lazy functional programs in Haskell any more.  In the Era of Monadic Enlighte

Re: [Haskell] line-based interactive program

2005-07-07 Thread Christian Maeder
mt wrote: > hi, > > i'd like to know how to write simply a line-based interactive program, that > is > one with which you have a 'talk'. I would start with: main = do putStrLn "Please enter text (or press return to exit):" s <- getLine if s /= "" then do putStrLn s

[Haskell] line-based interactive program

2005-07-07 Thread mt
hi, i'd like to know how to write simply a line-based interactive program, that is one with which you have a 'talk'. a simple filter-like line-based program ca be written as: -- a filter program process an entire input to yield some output type FilterProgram = [Line] -> [Line] but i don't knwo

[Haskell] Final Call for papers: MoveLog05 (ICLP workshop)

2005-07-07 Thread James Lipton
*** APOLOGIES FOR MULTIPLE POSTING ** FINAL CALL FOR PAPERS: JULY 10 DEADLINE MoVeLog'05 Mobile Code Safety and Program Verification Using Computational Logic Tools An ICLP Workshop, Sitges, Spain,