jyp_7 at yahoo.com
Tue Mar 16 04:05:17 EST 2004
--- Christian Maeder <maeder at tzi.de> wrote:
> JP Bernardy wrote:
> > A revision of DData.
> > http://users.skynet.be/jyp/DData/doc
> In Set, I find the name
> unnecessary long.
I'm tempted to drop the unchecked prefix. It is rather
obvious that monotonicity of the function is not
mapAsc doesn't appeal to me, because it makes less
explicit the monotonicity of the mapped function.
> Again, I suggest to omit toAscList (as it is the
> same as toList)
Yet, it has been shown that "toDescList" might be
needed, in a lazy setting. Thus, having the symmetric
"toAscList" is logical; even if the semantic is the
same a "toList".
> and to rename fromDistinctAscList to fromAscList and
> provide no extra
> treatment for ascending list with duplicates. (Maybe
> a linear nub
> variant can be provided elsewhere: ... = map head .
> group) Thus "Asc" could indicate unchecked variants
and always means strongly
> ascending. (Therefore I suggested "mapAsc")
This is quite a lot of changes wrt. the original. I'd
wait for more comments o this.
You also asked again if MultiSet should be renamed to
Bag. My argument went as such:
Daan's remark about the difference between bags and
A multi set differs from a /bag/ in the sense that it
is represented as a map from elements to occurrence
counts instead of retaining all elements. This means
that equality on elements should be defined as a
/structural/ equality instead of an equivalence
relation. If this is not the case, operations that
observe the elements, like 'filter' and 'fold',
should be used with care.
You argued that Eq is (nearly) always
assumed to be defined by structural equality, so "Bag"
would be just as good as "MultiSet".
Yet, a true "Bag" type may be added later, so I did
bother to change the name.
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
More information about the Libraries