> It strikes me that using Bits instead of Enum might be more likely to be what 
> people want in many cases

It wouldn't hurt for you (or someone) to implement this. I'm sure it
would be useful.

On Wed, Aug 12, 2009 at 2:09 AM, Ketil Malde<[email protected]> wrote:
> Felipe Lessa <[email protected]> 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).
>
> And perhaps also note that you will get exceptions for values outside
> the Enum range.
>
> 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.¹
>
> One could also question the sanity of using e.g. floating point values
> as keys, but Map supports this, so who am I to judge.
>
> (Also, a minor documentation niggle is that Haskell only guarantees 30
> bits for an Int, it's GHC that uses Ints of 32 and 64 bits.  One could
> argue that it is the report that should be fixed here, unless one can
> imagine a program that depends on correct modulo arithmetic with an
> unknown quotient.)
>
> -k
>
> ¹ This of course migth give the careless reader of the Report the
> impression that the Haskell community values speed over correctness,
> and thus that we actually are aiming for popularity and mainstream
> recognition after all.
> --
> If I haven't seen further, it is by standing in the footprints of giants
> _______________________________________________
> Haskell-Cafe mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to