So this is definitely a GHC bug, but I think the problem is probably triggered by this line:<br><br>instance  Serializable a b =&gt; IResource a <br><br>I don&#39;t think this is a valid instance declaration without a functional dependency on Serializable, as it&#39;s impossible to know which type &#39;b&#39; to use in the methods of IResource.<br>
<br>  -- ryan<br><br><div class="gmail_quote">On Tue, Jun 28, 2011 at 3:43 AM, Alberto G. Corona <span dir="ltr">&lt;<a href="mailto:agocorona@gmail.com">agocorona@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<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" target="_blank">http://www.haskell.org/ghc/reportabug</a></div>


</div><div><br></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>