Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occured while compiling qtHaskell

After qmake and mingw32-make from these instructions succeeds, and I execute runhaskell Setup.hs build, I get the following error:

[651 of 662] Compiling Qtc.Core.Attributes ( Qtc\Core\Attributes.hs, dist\build\Qtc\Core\Attributes.o )
Qtc\Core\Attributes.hs:584:13:
Could not deduce (Qstt a (QDialogSc b))
  arising from a use of `slotReject''
from the context (Qstt a (QDialogSc b1))
  bound by the instance declaration
  at Qtc\Core\Attributes.hs:582:10-52
Possible fix:
  add (Qstt a (QDialogSc b)) to the context of
    the instance declaration
  or add an instance declaration for (Qstt a (QDialogSc b))
In the expression: slotReject'
In an equation for `reject'': reject' = slotReject'
In the instance declaration for `QsaSlotReject a'

the Attributes.hs file (line 578 - 583):

class QsaSlotReject w where
  slotReject', reject' ::  (Qslot w (w -> ()), (w -> ()))

instance (Qstt a (QDialogSc b)) => QsaSlotReject (a) where
  slotReject' = (Qslot "reject()", \_ -> ())
  reject' = slotReject'

Environment :

  • Windows 7
  • Haskell Platform 2011.2.0
  • Qt sdk 4.7

btw, I encountered an out of memory twice in the process, but I guess that doesn't matter.

like image 502
SongPengpeng Avatar asked Mar 13 '11 15:03

SongPengpeng


1 Answers

The trouble comes from the fact that

data Qslot x f = Qslot String

so there's a bit of difficulty inferring what x and f might be from a given item of the form Qslot "Blah blah". Perhaps there has been a subtle change in the inference mechanism GHC uses since the last version of qthaskell went up last Fall.

In any case, it seems to compile, with some curious warnings, and the examples work, if you replace

 instance (Qstt a (QDialogSc b)) => QsaSlotReject (a) where
    slotReject' = (Qslot "reject()", \_ -> ())
    reject' = slotReject'

with

 instance (Qstt a (QDialogSc b)) => QsaSlotReject (a) where
   slotReject' = (Qslot "reject()", \_ -> ())
   reject' = (Qslot "reject()", \_ -> ())

That way ghc does't have to wonder quite as much...

There must be something that would make things more precise. I don't know if the eta reduce warnings that start cropping up systematically later have to do with this line.

like image 103
applicative Avatar answered Sep 25 '22 05:09

applicative