【问题标题】:Install of semigroups fails with cabal使用 cabal 安装 semigroups 失败
【发布时间】:2012-04-24 23:48:47
【问题描述】:

我想安装 Snap,但我是 Haskell 及其平台的新手。

我使用 cabal 安装 Snap,但无法安装 semigroups:

% cabal install snap
Resolving dependencies...
Configuring semigroups-0.8.3...
Preprocessing library semigroups-0.8.3...
Building semigroups-0.8.3...
[1 of 4] Compiling Numeric.Natural.Internal ( Numeric/Natural/Internal.hs, dist/build/Numeric/Natural/Internal.o )
[2 of 4] Compiling Numeric.Natural  ( Numeric/Natural.hs, dist/build/Numeric/Natural.o )
[3 of 4] Compiling Data.List.NonEmpty ( Data/List/NonEmpty.hs, dist/build/Data/List/NonEmpty.o )

Data/List/NonEmpty.hs:115:4:
    Can't make a derived instance of `Data (NonEmpty a)'
      (You need -XDeriveDataTypeable to derive an instance for this class)
    In the data type declaration for `NonEmpty'

Data/List/NonEmpty.hs:115:10:
    Can't make a derived instance of `Typeable (NonEmpty a)'
      (You need -XDeriveDataTypeable to derive an instance for this class)
    In the data type declaration for `NonEmpty'

这是我的阴谋集团:

% cabal --version
cabal-install version 0.10.2
using version 1.10.2.0 of the Cabal library 

我已经看到 semigroups 是许多 Snap 依赖项的依赖项,我该如何纠正这个安装?

我使用 gnome 在 ubuntu 中运行 « Vous utilisez actuellement Ubuntu 10.04 LTS - le Lynx Lucide - version sortie en avril 2010 »

编辑:

在 semigroups.cabal 文件的包中,我看到了这个:

  if !impl(hugs)
    other-extensions: DeriveDataTypeable
    cpp-options: -DLANGUAGE_DeriveDataTypeable

我可能不得不让 « impl(hugs) » 返回一些虚假的东西? (但我不知道它是什么:))

谢谢

【问题讨论】:

  • 该软件包似乎尚未针对更新的 GHC 进行测试,需要将 XDeriveDataTypeable 添加到其 .cabal 标志中。
  • 你知道我怎么设置这个标志吗?
  • 哦,添加到«它的».cabal标志,而不是我的。嗯……所以没什么可做的……
  • 你试过在本地通过 cabal-dev 安装它吗?
  • 我刚刚测试了 « cabal-dev install snap » 但也有同样的问题。我不知道我是否可以将标志传递给 cabal-dev。谢谢

标签: haskell cabal haskell-snap-framework haskell-platform cabal-install


【解决方案1】:

您可以通过 cabal 调用传递特定于 ghc 的标志

cabal install snap --ghc-option=-XDeriveDataTypeable

有关此类标志的更多信息,请参见Cabal Users Guide 的“用于构建的程序”部分。

【讨论】:

  • 工作。现在我看这个命令行时,«--ghc-option » 似乎很明显! ;) 谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-07
  • 1970-01-01
相关资源
最近更新 更多