I'm trying to build ghc-mtl-1.2.1.0 with ghc-7.8.3 and I'm getting these error messages:
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)
Same errors with ghc-7.8.2.
I have tried to figure out which of the over 9000 types and/or modules called Ghc and/or GHC and/or MonadIO is responsible for this, but so far no luck.
So my questions are:
- What change is responsible for this breakage?
- Is it possible to fix it without a downgrade from 7.8.3?
Answering my own question.
The problem was the transformers-0.4.1.0 package, which was installed alongside transformers-0.3.0.0 that comes with ghc. The transformers package provides
Control.Monad.IO.Class.MonadIOclass. It was pulled into build twice, once from transformers-0.4.1.0 and once from transformers-0.3.0.0, which resulted in a conflict.I have seen the duplicate package but didn't realize it was the source of the problem. My mistake was that I have hidden transformers-0.4.1.0 with
ghc-pkg hide, tried to build ghc-mtl, the problem persisted, and I decided that transformers was not the reason. Hiding is of course not enough, I should have removed it instead.Uninstalling transformers-0.4.1.0 and downgrading its dependencies solved the problem.