[Haskell] line-based interactive program
andrew at pimlott.net
Fri Jul 8 12:43:02 EDT 2005
On Fri, Jul 08, 2005 at 02:51:11PM +0100, Colin Runciman wrote:
> >>My interaction depends on the (subtle order of) evaluation of a pure and
> >>total function?
> Pure, yes; total, no.
> Many important things depend on order of evaluation in lazy programs:
> for example, whether they compute a well-defined value at all! The
> interleaving of demand in the argument of a function with computational
> progress in its result seems a perfectly natural view of interaction in
> a lazy functional language. This sort of interaction is what actually
> happens when your function applications are evaluated whether you
> exploit it or not. I embrace it as part of lazy functional programming;
> you prefer an appeal to something extraneous.
It is one thing to embrace lazy evaluation order, and another to embrace
lazy IO (implemented using unsafeInterleaveIO). As a relative newcomer
to Haskell, I got the impression that the "interact" style was always a
hack, discarded for good reason in favor of the IO monad. Is there a
strong case for interact?
More information about the Haskell