[snip] > No, optimistic evaluation does not work well with interact, because it > causes the input stream to be evaluated (and therefore demanded) earlier > than you would expect. This is the problem: interact exposes more than > just non-strictness, it exposes laziness. > > In Robert Ennals' implementation of optimistic evaluation he has to fall > back to lazy evaluation for lazy I/O, precisely because of this problem.
Or to put it another way. Optimistic Evaluation works fine with "interact". You can write programs that use interact, evaluate them optimistically, and they will behave exactly as they always did. Optimistic Evaluation takes care to never speculatively evaluate anything that could have externally visible effects. It is a guiding principle of Optimistic Evaluation that there should be no user-perceivable difference between optimistic evaluation and lazy evaluation. -Rob _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell