My code is quite simple:
data Direction a = North a | South
instance (Bounded tc) => Bounded (Direction tc) where
maxBound::(Direction tc) = North dc where dc = maxBound::tc
minBound::(Direction tc) = South
But I got the following error:
<interactive>:56:5: error:
Pattern bindings (except simple variables) not allowed in instance declaration:
maxBound :: (Direction tc)
= North dc
where
dc = maxBound :: vtc
<interactive>:57:5: error:
Pattern bindings (except simple variables) not allowed in instance declaration:
minBound :: (Direction tc) = South