编译qtHaskell时发生错误

时间:2011-03-13 15:55:16

标签: windows qt haskell

these指令的qmake和mingw32-make成功后, 我执行runhaskell Setup.hs build,我收到以下错误:

[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'

Attributes.hs文件(第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'

环境:

  • Windows 7
  • Haskell Platform 2011.2.0
  • Qt sdk 4.7
顺便说一句,我在这个过程中遇到了两次内存不足,但我猜这没关系。

1 个答案:

答案 0 :(得分:9)

问题来自于

data Qslot x f = Qslot String

所以从Qslot“Blah blah”形式的给定项目中推断x和f可能有点困难。自从上一版qthaskell于去年秋季推出以来,GHC使用的推理机制可能发生了微妙的变化。

在任何情况下,它似乎都会编译,带有一些好奇的警告,如果你替换

,这些例子都有用。
 instance (Qstt a (QDialogSc b)) => QsaSlotReject (a) where
    slotReject' = (Qslot "reject()", \_ -> ())
    reject' = slotReject'

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

这样ghc就不必怀疑相当 ......

必须有能使事情变得更加精确的东西。我不知道eta是否会减少警告,这些警告会在以后系统地开始出现,这与此行有关。