[Haskell] Enum class

Jaime Nino jaime at cs.uno.edu
Fri Jan 7 19:57:01 EST 2005

I would like to write a function with type
   next :: Enum a => a -> a

which will wrap a values around; that is
                next value == toEnum 0
where value is the last value of a.

I have not found any functionality on Enum types to do this. In
particular how to
specify the last element of any Enum type, or how to determine the
number of
elements in an Enum type.


Jaime Nino

More information about the Haskell mailing list