
On Sun, 21 Mar 2004, Alastair Reid wrote:
If Haskell implementations would use [++ optimisation], programmers could really spare some efforts and programs would be clearer.
In practice though, it is useful to have data structures, algorithms, etc. that already contain the optimization though.
Of course it is. But we do need data structures that perform well on a wide range of operations, not just one! That's why the CatenableSeq is useless in practice: it is easier to use closures or accumulators manually, which, for example, is done automatically when using 'foldr'.
Lesson: predictable performance is an important property.
Yeah, and just this was a feature of Wadler's proposal: his transformation is predictable.
Lesson: some programming decisions can't be automated.
Yeah, and in such cases it would be best, if the programmer could choose between two different implementations of the same abstract structure. However, the choice between CatenableSeq (or manual use of closures) and any other implementation will almost always be the other implementation Robert