On 20/01/12 16:31, Mikhail Arefiev wrote:
> Is there a reason why there is no instance of (Enum a) =>  IArray
> UArray a (other than that it will require OverlappingInstances and/or
> IncoherentInstances if e. g. UArray of Bools is used in the same
> code)?
>
> ...
>
> Does having such thing make any sense?

The problem is that there are Enum instances for things for which to/fromEnum doesn't make sense, such as Double, Float and Integer.

   Prelude> fromEnum (12345678901234567890 :: Integer)
   -6101065172474983726

You wouldn't want your Integers to be stored as Ints in an array.


Twan

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to