Edited at

cabal install ghc-modがmonad-controlのせいでコケたら

More than 3 years have passed since last update.


# cabal install ghc-mod

Resolving dependencies...
Configuring ghc-mod-
Building ghc-mod-
Failed to install ghc-mod-
Last 10 lines of the build log ( /Users/jun/.cabal/logs/ghc-mod- ):
[14 of 38] Compiling Language.Haskell.GhcMod.World ( Language/Haskell/GhcMod/World.hs, dist/build/Language/Haskell/GhcMod/World.o )
[15 of 38] Compiling Language.Haskell.GhcMod.CabalConfig ( Language/Haskell/GhcMod/CabalConfig.hs, dist/build/Language/Haskell/GhcMod/CabalConfig.o )
[16 of 38] Compiling Language.Haskell.GhcMod.CabalApi ( Language/Haskell/GhcMod/CabalApi.hs, dist/build/Language/Haskell/GhcMod/CabalApi.o )
[17 of 38] Compiling Language.Haskell.GhcMod.Cradle ( Language/Haskell/GhcMod/Cradle.hs, dist/build/Language/Haskell/GhcMod/Cradle.o )
[18 of 38] Compiling Language.Haskell.GhcMod.Monad ( Language/Haskell/GhcMod/Monad.hs, dist/build/Language/Haskell/GhcMod/Monad.o )

Wrong category of family instance; declaration was for a type synonym
In the newtype instance declaration for ‘StM’
In the instance declaration for ‘MonadBaseControl IO (GhcModT m)’
cabal: Error: some packages failed to install:
ghc-mod- failed during the building phase. The exception was:
ExitFailure 1

monad-control v1.0.xが原因のよう。すでにpull requestは出ているようだけど、まだmergeされていないようなので、monad-controlのv0.3.xを入れてやると動くようになった。

# cabal info monad-control

* monad-control (library)
Synopsis: Lift control operations, like exception catching, through
monad transformers
Versions available: 0.2,,,,,,,, (and 10 others)
Versions installed:

# ghc-pkg unregister --force monad-control
# cabal install monad-control-
# cabal install cabal-mod
Resolving dependencies...
In order, the following will be installed:
either- (reinstall) changes: monad-control- added
lifted-base- (reinstall) changes: monad-control- added
io-choice-0.0.5 (reinstall) changes: monad-control- added
monad-journal- (reinstall) changes: monad-control- added
ghc-mod- (new package)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring either-
Configuring lifted-base-
Building either-
Building lifted-base-
Installed lifted-base-
Configuring io-choice-0.0.5...
Building io-choice-0.0.5...
Installed either-
Configuring monad-journal-
Building monad-journal-
Installed io-choice-0.0.5
Installed monad-journal-
Configuring ghc-mod-
Building ghc-mod-
Installed ghc-mod-