[Haskell-cafe] multiple computations, same input

Greg Fitzgerald garious at gmail.com
Tue Mar 28 15:27:43 EST 2006

> ...Anyway, I can't help but think that there might be a happy medium
> between eager and lazy evaluation.

What I'd love to see is the compiler continue to be call-by-need, but be
smart enough to recognize when multiple expressions will all eventually need
to be evaluated.  A simple example:

    show (a + b)

(+) requires *both* 'a' and 'b' be evaluated to show the result, not 'a'
*then* 'b'.  It'd be great if the compiler can seek out any shared lazy data
structures in evaluating 'a' and 'b', and start computing them both with one
element at a time.

Has anyone put any thought into something like this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060328/3d1d4de0/attachment.htm

More information about the Haskell-Cafe mailing list