[clean-list] Clean's answer to the Functional Achilles-heel

Mark Phillips mark@austrics.com.au
Wed, 02 Jan 2002 15:29:47 +1030


Fergus Henderson wrote:
> 
> I had a brief glance at this paper.  This paper is about a completely
> different issue than I/O.  The "OO" approach that they talk about here
> could be done in Haskell, Clean, or Mercury using type classes, I believe.

Yes it is a different issue from I/O (I was digressing).  I will
take your word for it on the approach being able to be implemented under
Haskell, Clean and Mercury (because I am still new to the whole
functional programming area).  The paper seemed to be saying
that the functional approach was inadequate when it comes to adding
a new type of data structure to some collection of structures, because 
each of the functions which operate on the collection, would need to
be changed to accomodate the new type.  The paper first talked about
the "visitor pattern", which apparently is a "functional style" of
programming within the OO framework.  This pattern suffers from the
same "code reuse" problem associated with functional programming, but
the enhancement of the pattern, presented in the paper, overcomes this 
difficulty.  The impression I got was that the enhancement required
an OO framework.  But perhaps I was wrong about this.

Am I right in thinking that whereas older functional languages
had the "code reuse" problems described above, newer functional
languages have mechanisms which allow these problems to be
overcome?

Cheers,

Mark.