[Haskell-cafe] Announce: EnumMap-0.0.1

Henning Thielemann lemming at henning-thielemann.de
Sat Aug 8 18:11:44 EDT 2009

On Sat, 8 Aug 2009, John Van Enk wrote:

> That's originally how I was thinking about doing it, but I think that
> requires one to re-implement all the functions available in
> Data.IntMap as simple wrappers that do the toEnum/fromEnum conversion.
> I think making it into its own module is a little cleaner. The
> conversion from EnumMap to IntMap is substantially cleaner than from
> IntMap to EnumMap:
>> type IntMap v = EnumMap Int v

Can you implement EnumMap in terms of the Enum methods, without many 
conversions to Int? I mean, if you often convert to Int and back then you 
could achieve the same on top of IntMap. Generally I prefer the strategy 
"from simple to complex". I consider Enum to be a "wrapper" around Int.

More information about the Haskell-Cafe mailing list