[Haskell-cafe] Announce: EnumMap-0.0.1

Felipe Lessa felipe.lessa at gmail.com
Mon Aug 10 10:09:18 EDT 2009


On Mon, Aug 10, 2009 at 03:24:36PM +0200, Ketil Malde wrote:
> John Van Enk <vanenkj at gmail.com> writes:
> > EnumMap is a generalization of IntMap that constrains the key to Enum
> > rather than forcing it to be Int. I have no idea what impact this has
> > on performance,
>
> Will it have an impact on correctness?  There are some funky Enum
> instances around:

IMO it's implicit that keys overwrite eachother whenever their
'fromEnum' is equal, however that may be spoken in the docs.
Depending on what you want you may or may not desire to have this
behaviour, but this is how this data structure works.

So, yes, it's correct, just different. :)

--
Felipe.


More information about the Haskell-Cafe mailing list