[Haskell-cafe] Re: Why no merge and listDiff?

Will Ness will_n48 at yahoo.com
Wed Jan 20 14:34:15 EST 2010

Christian Maeder <Christian.Maeder <at> dfki.de> writes:

> Will Ness schrieb:
> > I meant strictly increasing ordered lists, without multiples, for which the 
> > operations, 'merge' and 'minus', would also have to produce like lists, i.e 
> > strictly increasing, without multiples.
> Why don't you use directly Data.Set?

It says it's based on size balanced Trees? I initially wondered why no such 
fundamental operations as merge and minus for _lists_, in the stadard libraries?

Also, its to/from list conversions are O(n), so probably won't work for 
infinite lists. 

I was told the trend is to move specifics to hackage packages, but I wonder why 
shouldn't such fundamental operations be just included in standard Data.List?

> > I guess the first variety is more appropriate for bags, and the second one
> > - for sets. The two would have to be de-conflated for that. (?)
> There are also bags aka multisets:
> http://hackage.haskell.org/package/multiset

it's too seems to be based on trees.

Data.Ordlist seems to be a good match, except for its conflation of 
ascending/non-decreasing lists under one "ordered" category (i.e. sets/bags 

More information about the Haskell-Cafe mailing list