DData revision (isSubsetOf / shorter names)

Ketil Malde ketil+haskell at ii.uib.no
Wed Mar 17 08:55:22 EST 2004


Daan Leijen <daanleijen at xs4all.nl> writes:

> On Tue, 16 Mar 2004 12:44:03 +0100, Christian Maeder <maeder at tzi.de> 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


More information about the Libraries mailing list