3

我想安装 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 版本:

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

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

我在 ubuntu 中运行 gnome « 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) » 返回一些虚假的东西?(但我不知道它是什么:))

谢谢

4

1 回答 1

2

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

cabal install snap --ghc-option=-XDeriveDataTypeable

有关这些标志的更多信息,请参见Cabal 用户指南的“用于构建的程序”部分。

于 2012-04-24T15:48:47.053 回答