
On Feb 2, 2008, at 18:41 , I wrote:
No instance for (Bounded a)
arising from use of `maxBound' at Hbot.hs:6:34-41
(...)
My (clearly flawed) understanding of the signature I've specified
The
*not* extend to
for 'turn' means *exactly* that a is Bounded. Brandon Allbery replied: problem is that the scope of a is the type signature; it does the definition.
You
can enable
can try omitting the type on maxBound and minBound, or you the scoped type variables extension Thank you. This compiles fine with the Glasgow extensions turned on as long as the type in the function signature is universally quantified: turn :: forall a. (Enum a, Bounded a) => Int -> a -> a turn n e = toEnum (add (fromEnum (maxBound::a) + 1) (fromEnum e) n) where add mod x y = (x + y + mod) `rem` mod
participants (1)
-
Ben Butler-Cole