Haskell
monad-control

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

More than 1 year has passed since last update.

editorからhaskellをいい感じに使えるらしいghc-modを入れようとしたら、コケた。

# cabal install ghc-mod
Resolving dependencies...
Configuring ghc-mod-5.2.1.1...
Building ghc-mod-5.2.1.1...
Failed to install ghc-mod-5.2.1.1
Last 10 lines of the build log ( /Users/jun/.cabal/logs/ghc-mod-5.2.1.1.log ):
[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 )

Language/Haskell/GhcMod/Monad.hs:370:5:
    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-5.2.1.1 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, 0.2.0.2, 0.2.0.3, 0.3.1.4, 0.3.2.2, 0.3.2.3,
                        0.3.3.0, 1.0.0.0, 1.0.0.1 (and 10 others)
    Versions installed: 1.0.0.1


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