haskell - 半组安装因 cabal 失败

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

我想安装 Snap,但我对 Haskell 及其平台还不熟悉。

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

% 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 版本:

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

我发现半群是许多 Snap 依赖项的依赖项,我该如何更正此安装?

我在 ubuntu 上运行 gnome « 您使用 Ubuntu 10.04 LTS - le Lynx Lucide - avril 2010 版本 »

编辑:

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

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

我可能必须让“impl(hugs)”返回一些虚假的东西? (但我不知道它是什么:))

谢谢

最佳答案

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

cabal install snap --ghc-option=-XDeriveDataTypeable

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

关于haskell - 半组安装因 cabal 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10297722/

相关文章:

Docker 失败并显示 "failed to start containerd: timeout waiting for containerd to start"

haskell - 对于高性能应用服务器,我应该选择Yesod的Warp和snap-server中的哪一个?

haskell - Snaplet 到 SnapletLens(snaplet 初始化)

Haskell 静态计算

haskell - 惰性交错包含在 IO monad 内的纯计算

haskell - 我的 Haskell 包可以依赖哪些版本的包?

haskell - Cabal 库与 cabal 安装。有什么不同?

haskell - 如何使用不依赖 hackage 的自定义版本的依赖项构建沙盒 cabal 项目(例如从 github checkout )

haskell - 为什么引入严格性的函数称为 seq?

list - 从 Haskell 列表中删除第一个和最后一个元素