首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Haskell中的依赖地狱(cabal,uu-parsinglib)

Haskell中的依赖地狱(cabal,uu-parsinglib)
EN

Stack Overflow用户
提问于 2020-04-01 10:53:23
回答 1查看 75关注 0票数 0

我正在尝试编译一个Haskell程序,它已经有几年的历史了,实际上已经不再需要维护了。它有一个很长的依赖项列表,需要我安装一个旧版本的uu-parsinglib。具体地说,它计算出它需要uu-parsinglib-2.7.4.3,但我得到了一个奇怪的编译错误。我是一个相当有经验的程序员,但不是在Haskell,所以我在这里有点摸不着头脑。卡巴尔给了我以下错误:

代码语言:javascript
复制
Failed to install uu-parsinglib-2.7.4.3
Build log ( /Users/pkirlin/projects/hvkoops-ragtime/hvkoops-ragpat-share-6184a5258723/.cabal-sandbox/logs/ghc-7.8.2/uu-parsinglib-2.7.4.3-BnfDYkqunLjFMHWw4iokbw.log ):
cabal: Entering directory '/var/folders/hc/98p9h4tj67b2zvnr2zbmg2_r0000gn/T/cabal-tmp-17434/uu-parsinglib-2.7.4.3'
Configuring uu-parsinglib-2.7.4.3...
Preprocessing library for uu-parsinglib-2.7.4.3..
Building library for uu-parsinglib-2.7.4.3..
[ 1 of 11] Compiling Text.ParserCombinators.UU.README ( src/Text/ParserCombinators/UU/README.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/README.o )
[ 2 of 11] Compiling Text.ParserCombinators.UU.CHANGELOG ( src/Text/ParserCombinators/UU/CHANGELOG.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/CHANGELOG.o )
[ 3 of 11] Compiling Text.ParserCombinators.UU.Core ( src/Text/ParserCombinators/UU/Core.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/Core.o )
[ 4 of 11] Compiling Text.ParserCombinators.UU.Derived ( src/Text/ParserCombinators/UU/Derived.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/Derived.o )
[ 5 of 11] Compiling Text.ParserCombinators.UU.MergeAndPermute ( src/Text/ParserCombinators/UU/MergeAndPermute.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/MergeAndPermute.o )
[ 6 of 11] Compiling Text.ParserCombinators.UU.BasicInstances ( src/Text/ParserCombinators/UU/BasicInstances.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/BasicInstances.o )
[ 7 of 11] Compiling Text.ParserCombinators.UU.Utils ( src/Text/ParserCombinators/UU/Utils.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/Utils.o )
[ 8 of 11] Compiling Text.ParserCombinators.UU ( src/Text/ParserCombinators/UU.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU.o )
[ 9 of 11] Compiling Text.ParserCombinators.UU.Demo.Examples ( src/Text/ParserCombinators/UU/Demo/Examples.hs, dist/dist-sandbox-e96cf9a6/build/Text/ParserCombinators/UU/Demo/Examples.o )

src/Text/ParserCombinators/UU/Demo/Examples.hs:98:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:99:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:100:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:101:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:102:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:103:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:104:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:105:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:106:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:107:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:108:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:109:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:110:11:
    Not in scope: data constructor ‘DEMO’

src/Text/ParserCombinators/UU/Demo/Examples.hs:111:11:
    Not in scope: data constructor ‘DEMO’
cabal: Leaving directory '/var/folders/hc/98p9h4tj67b2zvnr2zbmg2_r0000gn/T/cabal-tmp-17434/uu-parsinglib-2.7.4.3'
Completed    attoparsec-0.13.2.4
Completed    haskell-src-exts-1.20.3
cabal: Error: some packages failed to install:
HarmTrace-Base-1.4.0.1-E2utJuigfJU9TJbNodq6XT depends on
HarmTrace-Base-1.4.0.1 which failed to install.
uu-parsinglib-2.7.4.3-BnfDYkqunLjFMHWw4iokbw failed during the building phase.
The exception was:
ExitFailure 1

有人能帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2020-04-01 12:31:33

让我们来看看src/Text/ParserCombinators/UU/Demo/Examples.hs的几个相关部分

代码语言:javascript
复制
{-# LANGUAGE  FlexibleInstances,
              TypeSynonymInstances,
              MultiParamTypeClasses,
              Rank2Types, FlexibleContexts, NoMonomorphismRestriction,
              CPP  #-}

CPP应该启用C预处理器。

代码语言:javascript
复制
#define DEMO(p,i) demo "p" i p

这应该用不会导致这些错误的正确代码替换出现的DEMO

代码语言:javascript
复制
show_demos :: IO ()
show_demos = 
       do DEMO (pa,  "a")
          DEMO (pa,  "" )
          DEMO (pa,  "b")
          DEMO (((++) <$> pa <*> pa), "bbab")
          DEMO (pa,  "ba")
          DEMO (pa,  "aa")
          DEMO ((pCount pa :: Parser Int),                                 "aaa")
          DEMO ((do  {l <- pCount pa; pExact l pb}),                       "aaacabbbbb")
          DEMO ((amb ( (++) <$> pa2 <*> pa3 <|> (++) <$> pa3 <*> pa2)),    "aaaaa")
          DEMO ((pList pLower),                                            "doaitse")
          DEMO (paz,                                                       "abc2ez")
          DEMO ((max <$> pParens ((+1) <$> wfp) <*> wfp `opt` 0),          "((()))()(())")
          DEMO ((pa <|> pb <?> justamessage),                              "c")
          DEMO ((amb (pEither  parseIntString  pIntList)),                 "(123;456;789)")
--          DEMO ((pa *> pMunch ( `elem` "^=*") <* pb),                      "a^=^**^^b")

但很明显,这些错误并没有被替换,因为你会得到这些错误。我猜你的GHC版本真的真的很老了,因为prior to 6.8.1, CPP wasn't supported。请尝试更新到较新的GHC。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60962971

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档