[Haskell-cafe] Possible bug?

Peter Verswyvelen bugfact at gmail.com
Fri Feb 13 12:35:46 EST 2009


No the error I got was
Could not deduce (Controller m v c)
from the context (Controller m v c2)
      arising from a use of `MVC' at NM8\GUI\PanZoom.hs:126:32-65
    Possible fix:
      add (Controller m v c) to the context of the constructor `MVC'
    In the expression: MVC m v (PZC s z (unsafeCoerce c))
    In the definition of `panZoomedMVC'':
        panZoomedMVC' s z (MVC m v c) = MVC m v (PZC s z (unsafeCoerce c))

I got this after adding the type signature of

panZoomedMVC' :: (Controller m v c, PanZoomable z) =>
                 State -> z -> MVC m v -> MVC m v

But I don't have the problematic code anymore.

Anyway, I've hacking away here, as you can see from the unsafeCoerce call,
which is now not needed anymore ;)

On Fri, Feb 13, 2009 at 6:26 PM, Tillmann Rendel <rendel at cs.au.dk> wrote:

> Peter Verswyvelen wrote:
>
>> 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?
>>
>
> There are such cases where it is not a bug. For example, given
>
>  import Data.Map (fromList)
>
>  x a = fromList a
>
> ghci will happily report that x has type
>
>  Ord k => [(k, a)] -> Data.Map.Map k a
>
> but the name Data.Map.Map is not in scope in the module.
>
>  Tillmann
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090213/da7dbf66/attachment.htm


More information about the Haskell-Cafe mailing list