Data.Map questions

Jean-Philippe Bernardy jeanphilippe.bernardy at gmail.com
Wed Mar 30 05:57:06 EST 2005


On Tue, 29 Mar 2005 13:20:12 +0200, Johannes Waldmann
<waldmann at imn.htwk-leipzig.de> wrote:
> What does Ord guarantee?
> 
> I hope it is a total ordering compatible with  (==)
> (so that Maps could be elements of Sets etc.)
> If so, perhaps there should be a comment in the documentation.
>  From reading the source ghc-6.4/libraries/base/Data/Map.hs
> it is not clear why Eq uses toAscList but Ord uses toList -
> so perhaps there is some hidden magic?

The magic is rather simple since toList is simly aliased to
"toAscList". This is probably better changed to use toAscList.

Cheers,
JP.


More information about the Libraries mailing list