Ticket #2717 (closed proposal: invalid)

Opened 4 years ago

Last modified 7 days ago

Add nubWith, nubOrd

Reported by: Bart Massey Owned by:
Priority: normal Milestone: Not GHC
Component: libraries/base Version:
Keywords: Cc: gale@…, bgamari@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

This is a followup to my proposal #2629, which had a much more ambitious scheme. After much discussion, it was decided to put this smaller proposal on the table.

I've implemented a new function Data.List.nubWith that takes a "stop list" and "filtering function" as an argument, and filters its target list against the stop list. I've then implemented Data.Set.nubOrd in terms of nubWith. nubBy is left alone, since there's nothing obvious to be done about it. All of the nubs are still fully lazy.

Basic QuickCheck? tests have been written, and pass. Performance benchmarking shows my nubOrd implementation to be quite comparable to that of nub in cases where the latter performs well, and dramatically faster when nub performs poorly. In particular, nubOrd can work on long lists with long nubs, unlike the basic nub, which is hopeless.

Patch against current Darcs head attached.

Attachments

nub.patch Download (4.2 KB) - added by Bart Massey 4 years ago.
base.patch Download (1.2 KB) - added by Bart Massey 3 years ago.
containers.patch Download (4.3 KB) - added by Bart Massey 3 years ago.

Change History

Changed 4 years ago by Bart Massey

  Changed 4 years ago by Bart Massey

Discussion period two weeks, until 2008/11/3.

  Changed 4 years ago by igloo

  • difficulty set to Unknown
  • milestone set to Not GHC

Changed 3 years ago by Bart Massey

Changed 3 years ago by Bart Massey

  Changed 3 years ago by Bart Massey

I've attached two patches---base.patch against libraries/base and containers.patch against libraries/containers---that conform to the general list consensus on functionality. Data.List is now unchanged except for documentation. Data.Set implements nubOrd, and Data.IntSet? implements nubInt.

I will ask for one more round of patch review and then request that these patches be applied.

follow-up: ↓ 5   Changed 2 years ago by igloo

  • status changed from new to closed
  • failure set to None/Unknown
  • resolution set to wontfix

Looks like an abandoned proposal

in reply to: ↑ 4 ; follow-up: ↓ 7   Changed 2 years ago by YitzGale

  • status changed from closed to new
  • resolution wontfix deleted

Replying to igloo:

Looks like an abandoned proposal

Why? This is a good patch, long needed, with strong consensus on the list.

After the request for a final round of patch review, there were no further comments. I think the poster just forgot the last step of formally requesting that the patches be applied.

I think this should be applied.

  Changed 2 years ago by YitzGale

  • cc gale@… added

in reply to: ↑ 5   Changed 2 years ago by igloo

Replying to YitzGale:

Replying to igloo:

Looks like an abandoned proposal

Why?

Because the discussion and consensus was not summarised in the ticket. See  the library submissions process, "At the end of the discussion period".

  Changed 16 months ago by igloo

  • status changed from new to closed
  • resolution set to invalid

Proposal tickets are no longer needed as part of the library submissions process. Instead, a normal ticket should be created once consensus has been achieved. Please see the  process description for details.

  Changed 7 days ago by bgamari

  • cc bgamari@… added
Note: See TracTickets for help on using tickets.