[Haskell-cafe] Announce: EnumMap-0.0.1

Ketil Malde ketil at malde.org
Mon Aug 10 09:24:36 EDT 2009


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:

  Prelude> map fromEnum [1,1.5,2]
  [1,1,2]

  Prelude Data.Int> fromEnum (10000000000 :: Int64)
  *** Exception: Enum.fromEnum{Int64}: value (10000000000) is outside of Int's bounds (-2147483648,2147483647)

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell-Cafe mailing list