Ticket #4257 (closed proposal: fixed)

Opened 3 years ago

Last modified 3 years ago

Add strict versions of insertWith and insertWithKey to IntMap

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

Description

A strict version of insertWith is needed when the value stored in the IntMap is e.g. an Int or some other value that's more efficiently stored in WHNF.

Deadline: 2 weeks

Attachments

strict-insert-with.dpatch Download (3.9 KB) - added by tibbe 3 years ago.
strict-insert-with2.dpatch Download (15.1 KB) - added by tibbe 3 years ago.
Corrected version of strict-insert-with.dpatch

Change History

Changed 3 years ago by tibbe

Changed 3 years ago by igloo

  • milestone set to Not GHC

Changed 3 years ago by tibbe

  • status changed from new to merge

No objections within 5 weeks. Please merge.

Changed 3 years ago by igloo

  • status changed from merge to new

Changed 3 years ago by igloo

'merge' is the wrong state for this; please use 'patch'.

Was this proposal discussed on the mailing list? Can you add a link to the proposal thread please?

insertWithKey' calls insertWithKey; is that really right?

Changed 3 years ago by tibbe

Here's the libraries email:  http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/13489

insertWithKey' should call insertWithKey' in the recursive call! Could you fix that when applying or should I add a new patch?

Changed 3 years ago by tibbe

Corrected version of strict-insert-with.dpatch

Changed 3 years ago by tibbe

  • status changed from new to patch

I've attached a fixed version of the patch that applies cleanly to the current HEAD. Please apply.

Changed 3 years ago by milan

  • cc fox@… added

Changed 3 years ago by igloo

  • status changed from patch to closed
  • resolution set to fixed

Applied, and I took the liberty of making a few tweaks:

Sun Nov 28 17:50:28 GMT 2010  Ian Lynagh <igloo@earth.li>
  * Tweak insertWith' and insertWithKey' to better match the non-' versions
  They now are not marked inlinable, force the key, and are exported.
Note: See TracTickets for help on using tickets.