sequences

Wolfgang Thaller wolfgang.thaller at gmx.net
Thu Apr 15 13:36:08 EDT 2004


I think I'm reluctant to accept Dessy as "the" collection framework 
mainly because you're trying to sell a big package of many changes at 
the same time - maybe that's also the reason why no one(?) else 
publicly said "I want Dessy".
Dessy seems to include several new ideas, and I don't want to get them 
all in one package. At a first glance, Dessy seems to include (forgive 
me if I forgot something important):

1) a hierarchy of Collection classes, based on MPTC without FunDeps

2) Implementations to go along with it

3) Lots of "propaganda" against lists and a proposal to change the 
language to remove it's bias towards lists

4) A "Stream" type whose only purpose seems to be to avoid using list 
syntax when the semantics of singly-linked lists are required

5) Some obvious naming changes like head --> first

6) A blasphemous tendency to use underscores in names :-)

People aren't quite done arguing whether the collection classes should 
rather use fundeps, or whether we should have a single-parameter 
Sequence class, etc.

I guess no one has yet even taken a serious look at your 
implementations - but if there was anything wrong with the 
implementations, that could be fixed later.

Number 3 is bound to spark some long discussions; and as it's a major 
(and incompatible) change to the language rather than the libraries, 
it's not going to happen anytime soon. We need a useful sequence 
framework that is used by many people first, only then will you be able 
to convince people that [1,2,3] should denote "a sequence" rather than 
"a list".

Number 4 doesn't make much sense without Number 3.

Number 5 definitely makes sense (although I haven't had a look at all 
of your names yet). It will be painful, though, and there will 
definitely be many people who just write modules with declarations like 
"head xs = first xs".

Number 6:
Veto. (OK, I don't have the right to veto anything, but you know what I 
mean).

> I'm ready to fight it, even ready to loose it, but since underscores 
> are
> just the better thing (by psychological studies), I'll try to push the
> change.

Aha, proof by appeal to authority ;-). What psychological studies? Who 
did they use as test subjects? UNIX C programmers? Windows C 
programmers? Java programmers? People who have never programmed before? 
For me, code without underscores is definitely more readable, so it 
might just depend on what you are accustomed to.
Also, when you try to push that change, think about how big a change 
you are advocating; it's not about but_first versus butFirst only. If 
the new collection framework is the only place where underscores are 
used in names, then that's bad, because inconsistency is definitely a 
bad thing. We'd have to change the other libraries to match (will all 
the other library maintainers agree to do this?). And I'd have to 
change my code to match. After I've changed my library calls, my own 
function names would look out-of-place. Ugh.
I think you simply can't "change" the naming style used in Haskell. You 
can only either "submit" to the predominant style that has brought us 
relative "harmony" (compared to C), or you can defend the right to use 
your own style in addition to the predominant style. I like the fact 
that almost all Haskell code I come accross uses the same naming style, 
but maybe that's just because it happens to agree with my own 
preference.
>
>> ... why shouldn't the running time of operations on other sequences be
>> defined relative to lists?
>
> If every programmer has to learn that 'last' takes time O(N) before he
> learns that better implementations exist, this will certainly be no 
> good.

I'd agree soon as point 3) above is "accepted" and the "list bias" in 
the language is removed. As long as we have a language where lists are 
the standard sequence type that appears everywhere, we can safely 
assume that every programmer *will* learn how to use lists before he 
learns about other collection types.

>> Absurdness? Ridiculous? Your language is very strong.
>
> Yes.  If I wouldn't think the advantages of a democratic approach are 
> very
> big, I couldn't defend such a big change.

Mhm. We seem to have a small clash of cultures here. Down here in 
old-fashioned Austria, calling somebody's opinion both absurd and 
ridiculous in the same sentence is sometimes considered equivalent to a 
personal insult. The mere fact that sensible people have written 
programs that use lots of singly-linked lists proves that it's neither 
absurd nor ridiculous. The "democratic" approach might be a lot better, 
but that doesn't make the old approach ridiculous or absurd.
Sorry for complaining about this, I know I shouldn't be that 
narrow-minded...


Cheers,

Wolfgang



More information about the Libraries mailing list