> > My first attempt to define a MPC and some instances failed partially.
> > I am not sure, if it is a bug or a feature. The class OMSObjAttrAppC
> > should restrict the possible combinations of objects and attributes,
> > so that attributes can only be read from objects to which they
> > belong. Every Object which is an instance of Class OMSIdObjectC has a
> > certain Attribute. So every instance of that class should be in the
> > combinations that are permitted to use oAGet e.g.
> >
> > The MPC is:
> >
> > class (OMSObjectC o,OMSObjAttrC a,OMSAttrValC av) =>
> > OMSObjAttrAppC o a av where
> > oAGet :: IO (a o) -> IO av
> > oAGet' :: (a o) -> IO av
> > oASet :: IO (a o) -> av -> IO ()
> > oASet' :: (a o) -> av -> IO ()
Definite bug. Thanks.
You can fix it thus. In TcInstDecls, around line 683
change one line (the last line of the following snippet:
-- DERIVING CHECK
-- It is obviously illegal to have an explicit instance
-- for something that we are also planning to `derive'
| maybeToBool tyconapp_maybe && clas `elem` (tyConDerivings inst_tycon)
Simon