Illegal type synonym family application in instance (Was: Breakage with 6.10)

Niklas Broberg niklas.broberg at gmail.com
Fri Oct 10 20:45:08 EDT 2008


>  Could someone help me point out the problem here? The relevant code is:
>
>  instance XMLGen m => EmbedAsChild m (XML m) where
>   asChild = return . return . xmlToChild
>
>  class XMLGen m => EmbedAsChild m c where
>   asChild :: c -> GenChildList m
>
>  class Monad m => XMLGen m where
>   type XML m
>   ....

Eh, reading that again I realize there's a bit code needed to
understand the above. So here's *really* the relevant code:

----------------
class Monad m => XMLGen m where
 type XML m
 data Child m
 xmlToChild :: XML m -> Child m
 [....]

class XMLGen m => EmbedAsChild m c where
 asChild :: c -> GenChildList m

instance XMLGen m => EmbedAsChild m (XML m) where
 asChild = return . return . xmlToChild
----------------

... and just a note that GenChildList is a type synonym for a certain
monad returning a list, hence the double returns. :-)

Cheers,

/Niklas


More information about the Glasgow-haskell-users mailing list