Map, Set libraries

Serge D. Mechveliani mechvel at botik.ru
Thu Jun 2 05:44:43 EDT 2005


Thanks to people for the explanations.
To my question

>> 1.  elems     :: Set a -> [a]
>>     setToList :: Set a -> [a]
>> 
>>   These two look like synonyms, but have different comments.
>>   Am I missing something? 

Jens Fisseler <jens.fisseler at fernuni-hagen.de>
writes on  2 Jun 2005

> Both functions compute the same list, and IMHO the comments state the
> same.

I meant the description in the ghc-6.4 documentation.
Data.Set.html  says
"
  elems :: Set a -> [a]
  O(n). The elements of a set.

  setToList :: Set a -> [a]
  O(n). Convert the set to a list elements.
"
What is the difference? 
If they are really equivalent, then, it is natural either to
remove `elems' or to follow the general GHC policy and to move 
setToList  to the `Obsolete' list section in documentation, like
it was done with many other functions for Set and FiniteMap.    
- ?

-----------------
Serge Mechveliani
mechvel at botik.ru






More information about the Glasgow-haskell-users mailing list