[clean-list] Why functional programming matters more

Fergus Henderson fjh@cs.mu.OZ.AU
Tue, 11 Dec 2001 13:03:13 +1100


On 10-Dec-2001, Erik Zuurbier <EZuurbier@Abz.nl> wrote:
> In his famous paper, John Hughes elaborates on an example where a game tree
> is generated lazily and then pruned. Now say we want to insert a manual
> prune-step, where ocasionally a GUI would display a little window, asking
> the user: "Is this a good move?" I think we would have to rewrite the
> algorithm completely and chain a unique environment (*World or *IOState)
> through it, just to take care of the GUI-IO.  I am afraid that this would
> completely destroy the beauty of the lazy algorithm.

I don't see why the game tree generator would need to change at all.
That could surely remain the same pure lazy function that it was
originally.  Only the pruning part would need to change.

Even for the pruning part, chaining a unique environment through
is not what I would call a complete rewrite.

As for the beauty of the lazy algorithm, I think the biggest factor in
making it beautiful is the nice separation of concerns between the lazy
generator and the pruner, and that would remain.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.