RE: DData revision (isSubsetOf / shorter names)

JP Bernardy wrote:
Now, where "isEmpty" is replaced by "null", I'ld rather see "subset" instead of "isSubsetOf", particularly also because "isProperSubsetOf" is so long.
I vote for consistently using isXXXX for predicates. Cheers, Simon

Simon Marlow wrote:
I vote for consistently using isXXXX for predicates.
this would (only) affect "null" (maybe "isEmpty" again) and "member". Please omit at least "Of" from XxxxOf, or what was the intention of "Of"? In Map this leads to a name "isProperSubsetOfBy" and apart form this "Subset" should become "Submap" within Map! Christian

Please omit at least "Of" from XxxxOf, or what was the intention of "Of"?
To me, this expresses the "infix meaning" of the predicate. Cheers, JP. __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com

On Tue, 16 Mar 2004 12:44:03 +0100, Christian Maeder
Simon Marlow wrote:
I vote for consistently using isXXXX for predicates.
this would (only) affect "null" (maybe "isEmpty" again) and "member".
Please omit at least "Of" from XxxxOf, or what was the intention of "Of"? In Map this leads to a name "isProperSubsetOfBy" and apart form this "Subset" should become "Submap" within Map!
Christian
So it is agreed: we use "isXXXX" :-) I am not sure about "XXXXOf" -- my taste says leave it out, but I once added it as it seems more consistent. I guess "submap" covers the meaning better than "subset" in the case of Map's. -- Daan. ps. I have a general remark towards nice cozy names like "subset", and "null", versus consistent COBOL names like "isSubsetOf" and "isEmpty", I believe that we should target an audience that sporadically uses the library and those people must be able to guess names -- the lenght of the name is not so important in that case, especially not for rarely used operations like "isProperSubsetOf". A hard-core user can always define "null = isEmpty; psubset = isProperSubsetOf" at the start of his module. (and I feel that "null" should be reserved for lists)
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Daan Leijen
On Tue, 16 Mar 2004 12:44:03 +0100, Christian Maeder
wrote: Simon Marlow wrote:
I vote for consistently using isXXXX for predicates.
Me too - while I'm not terribly fond of Hungarian notation, I always liked Scheme's predicate? and (to a slightly lesser extent) Lisp's predicate-p. Names like 'isEmpty' has the nice property of letting us use 'empty' for the constant (e.g. the empty set, finite map, whatever)
this would (only) affect "null" (maybe "isEmpty" again) and "member".
So it is agreed: we use "isXXXX" :-)
Hmm... s1 `isSubsetOf` s2 vs s1 `isSubset` s2 isSubsetOf s1 s2 isSubset s1 s2 I'm not sure I have any clear preference. ..Of reads slightly clearer in infix notation, but is arguably a bit more confusing in prefix.
ps. I have a general remark towards nice cozy names like "subset", and "null", versus consistent COBOL names like "isSubsetOf" and "isEmpty", I believe that we should target an audience that sporadically uses the library and those people must be able to guess names
I think the most important thing is to have a nice, consistent, language-wide convention. I've often wanted the operator vs. function application preference done the opposite way, but at least I have a simple rule to disambiguate, so I don't have to look it up all the time. -kzm -- If I haven't seen further, it is by standing in the footprints of giants

Daan Leijen wrote:
I vote for consistently using isXXXX for predicates.
this would (only) affect "null" (maybe "isEmpty" again) and "member".
So it is agreed: we use "isXXXX" :-)
does "isIn" meet someone's taste for "member" then? (I would not like "isMemberOf") Christian

Christian Maeder wrote:
does "isIn" meet someone's taste for "member" then?
or "isElem" (again I'ld find "isElementOf" too long) It would be nice if there were consistent names for lists, sets, maps and bags, simply to easy remembering a name. Since the list names are fixed it would be okay for me to have "null" and "elem" (and "subset") for sets as well. Alternatively, is it possible to add new names to the Prelude, e.g. "isEmpty" for lists? Christian

Now, where "isEmpty" is replaced by "null", I'ld rather see "subset" instead of "isSubsetOf", particularly also because
"isProperSubsetOf" is so long.
I vote for consistently using isXXXX for predicates.
Maybe I should remind the main guideline I used for naming: follow the naming scheme of "Data.List" as close as possible, for maximal consistency inside hierarchical libraries. This justifies "isSubsetOf" (modelled after "isPrefixOf"), and "null". I notice that "null" is not classified as a predicate in Data.List documentation. "isEmpty" can always be added, but then, it would be logical to add such a function for lists too. Cheers, JP. __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com

hi, i don't want to get involved in that (thanks for doing it guys!) i prefer the shorter names likes "empty", "subset" and "elem", without the "is" and "Of" (simply a metter of taste). the list module is not very consistent in the naming, so while it may be nice to be compatable with it, i woun't go too far with that. for example, names like "null" and "nub" could probably be improved. -iavor Simon Marlow wrote:
JP Bernardy wrote:
Now, where "isEmpty" is replaced by "null", I'ld rather see "subset" instead of "isSubsetOf", particularly also because "isProperSubsetOf" is so long.
I vote for consistently using isXXXX for predicates.
Cheers, Simon _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

the list module is not very consistent in the naming, so while it may be nice to be compatable with it, i woun't go too far with that.
I expect most haskellers to know the List module inside out. So they'll propably be confortable with something very close to it. Additionally, lists cannot be discarded, so we'll have to keep the list module. Having to remember two sets of conventions would not please me.
for example, names like "null" and "nub" could probably be improved.
If anything has to be improved, let it be the list module, and the rest would follow. Cheers, JP. __________________________________ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com
participants (6)
-
Christian Maeder
-
Daan Leijen
-
Iavor S. Diatchki
-
JP Bernardy
-
Ketil Malde
-
Simon Marlow