
I have an "'impossible' happened" error. The code may look a little bit convoluted but it is part of my real code.: --------- begin of code------ {-# LANGUAGE FlexibleInstances, UndecidableInstances , MultiParamTypeClasses #-} class Serializable a b class IResource a --The rest of the instance definitions does not matter for the error instance Serializable a b => IResource a data DBRef a= DBRef String a instance (IResource a) => Read (DBRef a) data Votation a= Votation{ content :: DBRef a } deriving (Read) ------------------------------- end of code --- gives the following error at compilation time: tests>runghc impossiblelloop.hs ghc: panic! (the 'impossible' happened) (GHC version 7.0.3 for i386-unknown-mingw32): solveDerivEqns: probable loop (impossiblelloop.hs:20:13-16 main:Main.$fReadVotation{v rhI} [a{tv abB} [tv] ] base:GHC.Read.Read{tc 2d} [main:Main.Votation{tc rbo} a{tv abB} [tv]] = [base:GHC.Read.Read{tc 2d} (main:Main.DBRef{tc rbu} a{tv abB} [tv])]) [[main:Main.Serializable{tc rbA} a{tv abB} [tv] b{tv ajE} [tcs]]] Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug