Making Int{Map,Set} polymorphic over the key type

Georg Rudoy 0xd34df00d at
Sat Jun 29 16:46:31 UTC 2019

Hi folks,

What do you think about making IntMap and IntSet polymorphic over the keys
as long as the key type k is Coercible to Int?

The motivation is that oftentimes one needs to have a collection of newtype
wrappers around Int, and then they have to either unpack/repack it around
the relevant containers (which is not nice), or just use HashMap/HashSet
(which is perhaps suboptimal).

If this is a direction the community might deem reasonable, I'd be happy to
work on this and make a PR to the containers repo (perhaps after discussing
the specific details about naming, etc).

  Georg Rudoy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list