[Haskell] RFC: DData in hierarchical libraries

Daan Leijen daanleijen at xs4all.nl
Thu Mar 11 15:58:26 EST 2004


>>> Set.toAscList is not really necessary as it is the same as Set.toList.
>>
>> Not necessarily: the lists from Set.toList will be equal for equal Set's, but may be unordered. Use "toAscList" or "toDescList" if you want an ordered variant.

> That really surprises me. I think that toList must return a sorted list (to properly abstract the Set data type), and anything unsorted should only be for debugging purposes.

You are right! Indeed, for a proper abstraction, we should specify the order...
hmm, that means we need to reconsider either the naming scheme (that is, remove
toAscList and call it toList) or specify explicitly the order that is returned
right now.

-- Daan.



More information about the Libraries mailing list