[Haskell-cafe] ANN: data-ordlist-0.2
Leon Smith
leon.p.smith at gmail.com
Sun Feb 7 15:50:26 EST 2010
On Sun, Feb 7, 2010 at 6:43 AM, Ross Paterson <ross at soi.city.ac.uk> wrote:
>
> Why not wrap lists as Set and Bag abstract datatypes? An added bonus
> is that you could make them instances of Monoid.
Well, my current thinking is that if you really want an abstract
datatype for bags and sets, hackage (and the standard GHC
distribution) offer a multitude of options. Previous versions of the
code in data-ordlist dates back 9 years or more; I extracted and
refurbished data-ordlist from a mess of miscellaneous list functions I
use.
Personally, I've never really used this code as an abstract datatype;
my typical use cases break the set and bag abstractions to some
extent. I use a few functions when I happen to know the lists I'm
dealing with are ordered, and want a simple and efficient way to
manipulate them. The functions I most often use are sortOn, sortOn',
nubSort, and to a somewhat lesser extent, the set-like operators.
I put this package on hackage as much for my own personal convenience
as for others; but I do hope that other people will find it useful.
I realize that others might use it in rather different ways than I do,
and am open to suggestions and proposals.
Cheers,
Leon
More information about the Haskell-Cafe
mailing list