1

截至撰写本文时,我正在运行最新的 GHC (7.9.20140608) 和 cabal (1.20.0.0),但似乎attoparsec失败了。

Data/Attoparsec/ByteString/Internal.hs:519:7:
    Illegal equational constraint a_audv ~ (ByteString, t)
    (Use GADTs or TypeFamilies to permit this)
    In the context: (a_audv ~ (ByteString, t))
    While checking the inferred type for ‘succ'’
    In the expression:
      let
        succ' t' pos' more' a
          = succ t' pos' more' (substring pos (pos' - pos) t', a)
      in runParser p t pos more lose succ'
    In the second argument of ‘($)’, namely
      ‘\ t pos more lose succ
         -> let succ' t' pos' more' a = ...
            in runParser p t pos more lose succ'’

我是否缺少任何语言扩展?还是这个问题会更棘手一点?这是我的阴谋集团文件: http: //lpaste.net/105329

对此的任何帮助都将令人难以置信:) 黑客快乐!

4

1 回答 1

2

目前,使用 ghc-7.8(如果您的发行版包管理器不包含它)的最佳方式是转到ghc 下载页面并按照当前稳定版本的说明进行操作。有二进制包,或者您可以从源代码安装(使用源代码 tarball,这可以像 一样简单./configure && make && make install,但您需要已经有一个工作的 ghc)。

如果您确实从源代码安装,您可能会考虑更改版本,例如更改为 7.8.2.1。您可以通过编辑然后执行before中的AC_INIT行来做到这一点。如果您这样做,并且还安装到特定于版本的位置(例如,可以通过 设置),您将能够将本地编译的版本与打包的安装(或平台,或任何其他版本)同时安装)。configure.acautoreconfconfigure/usr/local/ghc/ghc-7.8.2.1.src./configure --PREFIX=/path/to/install

请注意,ghc-7.8.3 即将发布(最多可能在两周内);这是一个错误修复版本。此外,目前还没有包含 ghc-7.8 的 Haskell 平台版本,因此目前无法选择。

于 2014-06-09T22:13:20.213 回答