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

Henning Thielemann lemming at henning-thielemann.de
Sat Jun 29 17:20:43 UTC 2019


On Sat, 29 Jun 2019, Georg Rudoy wrote:

> сб, 29 июн. 2019 г. в 13:01, Henning Thielemann <lemming at henning-thielemann.de>:
>> There is already the enummapset package.
>
> Isn't it using fromEnum/toEnum under the hood, which might have bigger
> performance penalty than `coerce`?

Right. However, I am using the package mostly for tasks where I do a lot 
of 'union' and 'intersection' where there is no need to convert individual 
elements. I only initialize sets with say, EnumSet.fromList, do a lot of 
'union', 'intersection', 'difference', that is, simple bit field 
operations, and then fetch the results with EnumSet.toAscList.


More information about the Libraries mailing list