What does FP do well? (was How to get functional software engineering experience?)

Karl-Filip Faxen kff@it.kth.se
Thu, 16 May 2002 15:37:38 +0200


Hi!

The listlessness stuff is a precursor to deforrestation, so it 
replaces lists by (fewer lists and) scalars. I do not think there
are any arrays involved.

The most important property for being able to convert a list to
an array is that there should never be two cons cells with the same
tail (cdr). A somewhat stronger requirement is that the spine of
the list can not be shared. Then there are the representation oriented
conditions: For each (:), [] and case over lists in the program,
it has to work over arrays or over linked lists or else the linked
list representation and the array representation must be distinguishable
at run-time. That's about it.

But what I really meant is, if I may rephrase it, that imperative 
programs might often be both faster and harder to write because they
embed more information about the abblication domain. That is, if you 
code in C and want an array, you must specify its size, so you have to 
think about your program and figure out that you only need 'x' items
here, wheras in Haskell you'd use a list and never have to think about 
what the upper bound on the length of the list is.

Cheers,

     /kff