An Alternative view of I/O programs, popular in earlier lazy functional programming languages, was to see the input and output as Strings, that is as lists of characters. Under that model an I/O program is a function
listIOprog :: Str->Str
This obviously makes sense in a 'batch' program, where al, the input is read before any output is produced but in fact it also works for interactive programs where input and output are interleaved, if the language is lazy. This is because in a lazy language we can began to print the result of a computation - the output of the interactive program here - before the arguement - the interactive input - is fully evaluated. As an example, repeadtely to rever lines of input under this model one can write
listIOprogram = unlines. map reverse . lines
I don't understand the bolded line. How can we evaluate the output before the actual inputs are given? For eg, take the function Sum x y = x+y, what would it mean to evaluate this without any numbers are given.