【问题标题】:ghc-mod fails to installghc-mod 安装失败
【发布时间】:2012-10-09 16:08:28
【问题描述】:

我刚刚将 Arch Linux 全新安装到虚拟机并安装了 GHC (7.6.1),cabal-install 版本为 1.16.0-2

我正在尝试为 haskell 编码设置环境,包括 ghcmod-vim 插件,这当然需要 ghc-mod。

运行 cabal install ghc-mod 会出现几个错误

Gap.hs:81:19:
    Couldn't match expected type `PprStyle -> String' with `[Char]'
    Expected type: String
      Actual type: PprStyle -> String
    Probable cause: `renderWithStyle' is applied to too few arguments
    In the expression: renderWithStyle d stl
    In an equation for `renderMsg':
        renderMsg d stl = renderWithStyle d stl

Gap.hs:81:35:
    Couldn't match expected type `DynFlags' with actual type `SDoc'
    In the first argument of `renderWithStyle', namely `d'
    In the expression: renderWithStyle d stl
    In an equation for `renderMsg':
        renderMsg d stl = renderWithStyle d stl

Gap.hs:81:37:
    Couldn't match type `SDoc' with `SDoc'
    In the second argument of `renderWithStyle', namely `stl'
    In the expression: renderWithStyle d stl
    In an equation for `renderMsg':
        renderMsg d stl = renderWithStyle d stl

Gap.hs:114:28:
    Couldn't match type `Module' with `ModuleName'
    Expected type: ModSummary -> ModuleName
      Actual type: ModSummary -> Module
    In the second argument of `(.)', namely `ms_mod'
    In the first argument of `map', namely `(IIModule . ms_mod)'
    In the first argument of `(<$>)', namely `map (IIModule . ms_mod)'

我真的不明白这些编译器错误是如何发生的,因为 ghc-mod 1.11.0 似乎已在 6 月份被用于 Hackage,而我对类似问题的搜索却一无所获。

关于如何解决这个问题的想法和解决方案?

【问题讨论】:

  • GHC 7.6.1 于 9 月发布。我猜您的选择基本上是 a) 降级到较旧的 GHC 版本(可能是 7.4.2?),或 b) 等待维护者更新软件包。
  • 你知道...我什至没有想到这一点。我只是看着基本版本在正确的范围内,然后想,“为什么这不起作用?!”谢谢!

标签: haskell ghc cabal cabal-install


【解决方案1】:

您可能想看看https://github.com/kazu-yamamoto/ghc-mod。最新的提交被称为“GHC 7.6.1 兼容性”,所以这个版本可能会解决你的问题。

【讨论】:

  • 是的!检查它,构建它,它就像一个魅力,谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-24
  • 1970-01-01
  • 1970-01-01
  • 2012-10-17
  • 1970-01-01
  • 2019-03-14
  • 1970-01-01
相关资源
最近更新 更多