Unfortunately it didn'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't match type `Unit subUnit3' with `Unit subUnit2'<div>
NB: `Unit' is a type function, and may not be injective</div><div><br></div><div>How can I say that "Unit subUnit3" is "Unit subUnit2"?</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 "<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">SetActiveSubUnits a" and "</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Set (ActiveSubUnit subUnit3)"</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"><<a href="mailto:stephen.tetley@gmail.com">stephen.tetley@gmail.com</a>></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)=> } is presumably introducing<br>
another type variable unrelated to 'a' in the function level type<br>
signature.<br>
<br>
Note, my suggestion is "by eye" - I haven'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>