Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

IntMap.delete allocates even for absent keys

Open
#1,220 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Quiet
Tech stack
haskell
Domain
performance

Research direction

Compare the linked IntMap.delete implementation in containers/src/Data/IntMap/Internal.hs at lines 966-974 with Map.delete in containers/src/Data/Map/Internal.hs at lines 941-955. Start by understanding why the implementations differ and how Word64Map is derived from IntMap. Done means establishing whether pointer checks or a separate deletion variant is warranted, with the chosen scope and expected behavior clearly defined.

Written by the indexing model from the issue text.

Description

performance

https://github.com/haskell/containers/blob/78da761ebcda243134218c062e4a9b94aaa39068/containers/src/Data/IntMap/Internal.hs#L966-L974

I noticed some code in GHC that performs a bunch of deletions (on the very similar Word64Map) with keys that are most likely absent from the map. So now I'm wondering whether to introduce pointer-checks in Word64Map.delete or to split off a delete_possiblyAbsent version or…

But since Word64Map is derived from IntMap, my first question is: why doesn't IntMap.delete perform these pointer-checks already, even though Map.delete does?

https://github.com/haskell/containers/blob/78da761ebcda243134218c062e4a9b94aaa39068/containers/src/Data/Map/Internal.hs#L941-L955

Dominant language
Haskell
Stars
355
Forks
194
Avg merge
2d 6h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/containers

All issues in haskell/containers

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.