
18 Feb
2007
18 Feb
'07
1:40 p.m.
On 2/18/07, Marc Weber
Why do I have to specify (Monad m) here again?
class (Monad m) => GetMV m a where ...
instance GetMV m c where ...
No instance for (Monad m) arising from the superclasses of an instance declaration possible fix: add (Monad m) to the instance declaration superclass context
The class just says that any instance *requires* an instance in Monad. Nothing more. So when you try to instantiate something in the class you have to ensure that it has an instance in Monad. A type variable "m" has no instance in the class "Monad" unless you constrain it to do so in the instance declaration (by doing "Monad m =>"). -- Sebastian Sylvan +46(0)736-818655 UIN: 44640862