[Haskell-cafe] Announce: EnumMap-0.0.1

John Van Enk vanenkj at gmail.com
Wed Aug 12 09:16:24 EDT 2009

On Wed, Aug 12, 2009 at 2:09 AM, Ketil Malde<ketil at malde.org> wrote:
> Felipe Lessa <felipe.lessa at gmail.com> writes:
>>> 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.
> I couldn't find anything explicit in the documentation.  I'd suggest a
> clear note at the top, dismissing the (IMO natural) notion that
> "EnumMap k v" behaves like "Map k v" (which was true for IntMap and
> Map Int, I believe).

I haven't updated any of the documentation from IntMap over s/IntMap/EnumMap/g.

> And perhaps also note that you will get exceptions for values outside
> the Enum range.

I'd think that part is obvious.

> It strikes me that using Bits instead of Enum might be more likely to
> be what people want in many cases - but perhaps that would be too slow?
> Also that Enum really should map to Integer, but again, that's a speed
> issue.¹

I think Enum is a little more natural--perhaps I'm wrong.

More information about the Haskell-Cafe mailing list