On Fri, 07 Jan 2005 18:57:01 -0600, Jaime Nino <[EMAIL PROTECTED]> wrote:
> 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. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It looks as if you really want to use the type class Bounded as well. You can use maxBound and minBound to find the last and first value of a Bounded type. If you impose the additional constraint Eq and Bounded you can write next like so: next :: (Enum a, Bounded a, Eq a) => a -> a next x | x == maxBound = minBound | otherwise = succ x /S -- Sebastian Sylvan +46(0)736-818655 UIN: 44640862 _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell