[email protected]
[Top] [All Lists]

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

Subject: [Haskell-cafe] Re: Why no merge and listDiff?
From: Will Ness
Date: Wed, 20 Jan 2010 19:34:15 +0000 UTC
Christian Maeder <Christian.Maeder <at> dfki.de> writes:

> Will Ness schrieb:
> > I meant strictly increasing ordered lists, without multiples, for which the 
two 
> > 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 
distinction).




_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>