

Self-optimizing data structures: using types to make lists faster - dons
http://donsbot.wordpress.com/2009/10/11/self-optimizing-data-structures-using-types-to-make-lists-faster/

======
chancho
C++1x and Haskell'' are going to differ only in syntax.

~~~
mahmud
I didn't know C++ had lazy-functional semantics.

------
viraptor
I'm not sure if I understand exactly what is the current limitation.

Is the main point of this to create something like [!a] ? (ok not really -
it's about parts of "a" being strict) Is it just the current syntax / spec
limitation that we can't do this? Can it be safely ported in this or some
other way into the standard list implementation?

~~~
dons
Hmm. No, its not about making it strict -- (!) already does that. It is about
changing the representation entirely, so that you get specialized code and
data for every different type, rather than reusing slower, general purpose
functions.

The code examples show the different, as do the pictures of the heap.

This is some kind of extremely aggressive, but uniform, specialization.

~~~
viraptor
Ok - I get it now. Sadly, I expected that type of optimisation to already take
place in GHC, which is why I was confused about what do they do differently.
But I see why that's hard now...

------
camccann
Articles like this always leave me torn with, on one hand, a deep fascination
with the power, potential, and elegance of Haskell, yet, on the other hand, a
nagging feeling that I'll never be quite smart enough to actually understand
it...

~~~
Flow
Failure is part of the process of understanding something.

I would guess that if you limited your ambition of using all the features in
the language to something you almost know well, after making some programs
using that feature-set, I'd guess you'll see the need for some better feature,
and there's a good chance it already exists.

Does not that sound reasonable to you?

