我想安装 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/