No the error I got was<div><br></div><div><div>Could not deduce (Controller m v c)<br></div><div><div>from the context (Controller m v c2)</div><div>&nbsp;&nbsp; &nbsp; &nbsp;arising from a use of `MVC&#39; at NM8\GUI\PanZoom.hs:126:32-65</div>
<div>&nbsp;&nbsp; &nbsp;Possible fix:</div><div>&nbsp;&nbsp; &nbsp; &nbsp;add (Controller m v c) to the context of the constructor `MVC&#39;</div><div>&nbsp;&nbsp; &nbsp;In the expression: MVC m v (PZC s z (unsafeCoerce c))</div><div>&nbsp;&nbsp; &nbsp;In the definition of `panZoomedMVC&#39;&#39;:</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;panZoomedMVC&#39; s z (MVC m v c) = MVC m v (PZC s z (unsafeCoerce c))</div><div><br></div></div><div><div>I got this after adding the type signature of</div><div><br></div><div>panZoomedMVC&#39; :: (Controller m v c, PanZoomable z) =&gt;</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; State -&gt; z -&gt; MVC m v -&gt; MVC m v</div><div><br></div><div>But I don&#39;t have the problematic code anymore.</div><div><br></div><div>Anyway, I&#39;ve hacking away here, as you can see from the unsafeCoerce call, which is now not needed anymore ;)</div>
<div><br></div><div>On Fri, Feb 13, 2009 at 6:26 PM, Tillmann Rendel <span dir="ltr">&lt;<a href="mailto:rendel@cs.au.dk">rendel@cs.au.dk</a>&gt;</span> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">Peter Verswyvelen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Could it be considered a bug when a function compiles fine without type signature, but when you add the type signature that GHCi reports with :type, it fails to compile?<br>
</blockquote>
<br></div>
There are such cases where it is not a bug. For example, given<br>
<br>
 &nbsp;import Data.Map (fromList)<br>
<br>
 &nbsp;x a = fromList a<br>
<br>
ghci will happily report that x has type<br>
<br>
 &nbsp;Ord k =&gt; [(k, a)] -&gt; Data.Map.Map k a<br>
<br>
but the name Data.Map.Map is not in scope in the module.<br><font color="#888888">
<br>
 &nbsp;Tillmann<br>
</font></blockquote></div><br></div>