Unfortunately it didn&#39;t work.<div>The error message is not so clear to me and my understanding in advanced Haskell type system is yet to weak to figure out what is going on.</div><div><br></div><div>Looking at the error messages seems that the type inference analyzes the code in two different direction and finds some inconsistency at some junction point.</div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">    Couldn&#39;t match type `Unit subUnit3&#39; with `Unit subUnit2&#39;<div>
    NB: `Unit&#39; is a type function, and may not be injective</div><div><br></div><div>How can I say that &quot;Unit subUnit3&quot; is &quot;Unit subUnit2&quot;?</div><div><br></div><div>The type of error message seems be caused by a very similar problem</div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>  </div><div>Could not deduce (a1 ~ ActiveSubUnit subUnit3)</div><div>  .......</div><div>  Expected type: SetActiveSubUnits a</div><div>  Actual type: Set (ActiveSubUnit subUnit3)</div>
</div></span><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>since &quot;<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">SetActiveSubUnits a&quot; and &quot;</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Set (ActiveSubUnit subUnit3)&quot;</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">  should have the same type.</span></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><br></div><div>Any new idea ?</div><div><br></div><div>Cheers,</div>
<div><br></div><div>Edgar Gomes</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_quote">On 26 March 2011 16:13, Stephen Tetley <span dir="ltr">&lt;<a href="mailto:stephen.tetley@gmail.com">stephen.tetley@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">For the specific error at line 265 I think you should be using<br>
ScopedTypeVariables and properly qualifying the type signature at the<br>
function level with a forall.<br>
<br>
The local annotation { ::(SubUnit a)=&gt; } is presumably introducing<br>
another type variable unrelated to &#39;a&#39; in the function level type<br>
signature.<br>
<br>
Note, my suggestion is &quot;by eye&quot; -  I haven&#39;t run the code, so it may<br>
not work or there may be other errors.<br>
<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>
</blockquote></div><br></div>