nntpnews.net

Global Usenet Archiver


Register

[Haskell-cafe] ANN: data-ordlist-0.2

Reply

  #1  
Old 07-02-10, 06:29 AM
Leon Smith
 
Posts: n/a
Default [Haskell-cafe] ANN: data-ordlist-0.2

I have released data-ordlist 0.2, with a number of changes:

1. The module name is now Data.List.Ordered, instead of Data.OrdList

2. Three bugfixes: (ack!) insertSet and insertBag assumed reverse-ordered
lists, nub failed to remove duplicates. Thanks to Topi Karvonen for
reporting the first problem.

3. One semantic change: old_nubBy f == new_nubBy (not . f). The new
version is better keeping with the spirit of the rest of the library, and
makes the old nub bug much more obvious. Now nubBy is the greedy algorithm
that returns a sublist such that for all binary predicates:

isSortedBy pred (nubBy pred xs) == True

4. Improved documentation, I hope! Please consider taking a look and
letting me know what you think.

Code:
Content visible to registered users only.
Cheers,
Leon

_______________________________________________
Haskell-Cafe mailing list
Code:
Content visible to registered users only.
Code:
Content visible to registered users only.
Reply With Quote
  #2  
Old 07-02-10, 11:44 AM
Ross Paterson
 
Posts: n/a
Default Re: [Haskell-cafe] ANN: data-ordlist-0.2

Why not wrap lists as Set and Bag abstract datatypes? An added bonus
is that you could make them instances of Monoid.
_______________________________________________
Haskell-Cafe mailing list
Code:
Content visible to registered users only.
Code:
Content visible to registered users only.
Reply With Quote
  #3  
Old 07-02-10, 08:50 PM
Leon Smith
 
Posts: n/a
Default Re: [Haskell-cafe] ANN: data-ordlist-0.2

On Sun, Feb 7, 2010 at 6:43 AM, Ross Paterson < - > 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
_______________________________________________
Haskell-Cafe mailing list
Code:
Content visible to registered users only.
Code:
Content visible to registered users only.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Haskell-cafe] ANN: Data.Stream 0.4 Wouter Swierstra fa.haskell 3 23-10-09 11:47 AM
[Haskell-cafe] [Haskell Cafe] Data construction: how to avoidboilerplate code? Paul Sujkov fa.haskell 3 30-07-09 08:14 AM
[Haskell-cafe] ANN: cautious-file 0.1.1: Ways to write a filecautiously, to avoid data loss Robin Green fa.haskell 2 20-07-09 01:03 PM
[Haskell] ANN: data-ordlist-0.0.1 and NumberSieves-0.0 Leon Smith fa.haskell 1 17-07-09 10:16 PM
[Haskell-cafe] ANN: data-spacepart - space partitioning datastructure[s] (initial release) Corey O'Connor fa.haskell 3 28-01-09 08:34 AM


All times are GMT +1. The time now is 11:00 PM. Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0



For ads on this site use independent advertising companies. These companies may use some data (which does not include your name, address, email address or telephone number) about your visits to this and other websites to create advertisements on products and services you might enjoy. If you'd like more information and to know the options available to prevent the use of such information by these companies, click here

Abuse Ticket System