<div>I have an &quot;&#39;impossible&#39; happened&quot; error. </div><div><br></div><div>The code may look a little bit convoluted but it is part of my real code.:</div><div><br></div><div><br></div><div>--------- begin of code------</div>

<div><br></div><div>{-# LANGUAGE   FlexibleInstances, UndecidableInstances</div><div>               , MultiParamTypeClasses</div><div>                #-}</div><div><br></div><div>class Serializable a b </div><div><br></div>

<div><br></div><div>class IResource a     --The rest of the instance definitions does not matter for the error</div><div><br></div><div><br></div><div>instance  Serializable a b =&gt; IResource a </div><div><br></div><div>

data DBRef a=  DBRef String   a</div><div><br></div><div><br></div><div>instance  (IResource a) =&gt; Read (DBRef a) </div><div>    </div><div><br></div><div>data   Votation a= Votation{</div><div>  content         :: DBRef a</div>

<div>} deriving (Read)</div><div><br></div><div>------------------------------- end of code ---</div><div><br></div><div>gives the following error at compilation time:</div><div><br></div><div><div>tests&gt;runghc impossiblelloop.hs</div>

<div>ghc: panic! (the &#39;impossible&#39; happened)</div><div>  (GHC version 7.0.3 for i386-unknown-mingw32):</div><div>        solveDerivEqns: probable loop</div><div>    (impossiblelloop.hs:20:13-16 main:Main.$fReadVotation{v rhI} [a{tv abB} [tv]</div>

<div>] base:GHC.Read.Read{tc 2d} [main:Main.Votation{tc rbo}</div><div><br></div><div>                               a{tv abB} [tv]] = [base:GHC.Read.Read{tc 2d}</div><div><br></div><div>                                                    (main:Main.DBRef{tc rbu}</div>

<div><br></div><div>                                                       a{tv abB} [tv])])</div><div>    [[main:Main.Serializable{tc rbA} a{tv abB} [tv] b{tv ajE} [tcs]]]</div><div><br></div><div>Please report this as a GHC bug:  <a href="http://www.haskell.org/ghc/reportabug">http://www.haskell.org/ghc/reportabug</a></div>

</div><div><br></div>