
9 Jan
2005
9 Jan
'05
11:50 p.m.
Sorry, that was a stupid error. I meant to use fromEnum:
next:: (Enum a, Bounded a) => a -> a next v = if (fromEnum v) == (fromEnum maxBound) then minBound else succ v
I don't think this will quite work if fromEnum:: a -> Int for type a, were not
injective. However, that might be part of the specification... I don't
remember.
It should be fine, so long as the preimage of (fromEnum maxBound) is
{maxBound}.
-Arjun
--
Arjun Guha