Ranges and the Enum class

Wolfgang Jeltsch wolfgang at jeltsch.net
Tue Mar 21 17:20:38 EST 2006

Am Dienstag, 21. März 2006 10:08 schrieb Malcolm Wallace:
> Wolfgang Jeltsch <wolfgang at jeltsch.net> writes:
> [...]

> > Why do we need toEnum and fromEnum at all?  As far as I know, they are
> > merely there to help people implement things like enumFrom.
> They are often useful for writing serialisation routines, and they see
> occasional use for other kinds of safe type coercion as well
>     (toEnum .  fromEnum)
> Regards,
>     Malcolm

Maybe they should be in a separate class.  Enum should be about enumerating, 
not “indexing”.

Best wishes,

More information about the Haskell-prime mailing list