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>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>

<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>