[Haskell] line-based interactive program

mt mtvo at info.fundp.ac.be
Thu Jul 7 06:24:35 EDT 2005


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 how to handle input/output such that the output can be 
printed before all the input exists (the user enter some lines, the program 
writes a response based on those lines, and so on)

what's the simplest/most elegant approach ?

thanks,
minh thu


More information about the Haskell mailing list