2

ghc-7.8.3 で ghc-mtl-1.2.1.0 をビルドしようとしていますが、次のエラー メッセージが表示されます。

Control/Monad/Ghc.hs:42:15:
    No instance for (GHC.MonadIO Ghc)
      arising from the 'deriving' clause of a data type declaration
    Possible fix:
      use a standalone 'deriving instance' declaration,
        so you can specify the instance context yourself
    When deriving the instance for (GHC.ExceptionMonad Ghc)

Control/Monad/Ghc.hs:46:15:
    No instance for (MonadIO GHC.Ghc)
      arising from the 'deriving' clause of a data type declaration
    Possible fix:
      use a standalone 'deriving instance' declaration,
        so you can specify the instance context yourself
    When deriving the instance for (MonadIO Ghc)

Control/Monad/Ghc.hs:49:15:
    No instance for (GHC.MonadIO Ghc)
      arising from the 'deriving' clause of a data type declaration
    Possible fix:
      use a standalone 'deriving instance' declaration,
        so you can specify the instance context yourself
    When deriving the instance for (GHC.GhcMonad Ghc)

ghc-7.8.2 と同じエラー。

Ghcand/or GHCand /or と呼ばれる 9000 を超えるタイプやモジュールのどれがMonadIO これに関与しているかを突き止めようとしましたが、今のところうまくいきません。

だから私の質問は:

  • この破損の原因となる変化は何ですか?
  • 7.8.3 からダウングレードせずに修正することはできますか?
4

1 に答える 1

1

私自身の質問に答えます。

問題は、ghc に付属のトランスフォーマー 0.3.0.0 と一緒にインストールされたトランスフォーマー 0.4.1.0 パッケージでした。トランスフォーマー パッケージはControl.Monad.IO.Class.MonadIOクラスを提供します。これは、トランスフォーマー 0.4.1.0 から 1 回、トランスフォーマー 0.3.0.0 から 1 回、2 回ビルドに取り込まれ、競合が発生しました。

重複したパッケージを見たことがありますが、それが問題の原因であることに気付きませんでした。私の間違いは、Transformers-0.4.1.0 を で非表示にしghc-pkg hide、ghc-mtl をビルドしようとしたことでした。問題は解決せず、トランスフォーマーが原因ではないと判断しました。もちろん、隠すだけでは十分ではありません。代わりに削除する必要がありました。

Transformers-0.4.1.0 をアンインストールし、その依存関係をダウングレードすることで問題が解決しました。

于 2014-07-20T19:18:32.667 に答える