首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装Quipper时出错-无法构建quipper-utils-0.9.0.0 (无法将类型'Maybe TH.Exp‘与’TH.Exp‘匹配)

安装Quipper时出错-无法构建quipper-utils-0.9.0.0 (无法将类型'Maybe TH.Exp‘与’TH.Exp‘匹配)
EN

Stack Overflow用户
提问于 2021-06-03 22:03:04
回答 2查看 49关注 0票数 1

尝试安装Quipper (quantum programming language for Haskell)时,抛出编译错误:

我的构建配置文件:-w ghc-9.0.1 -O1

代码语言:javascript
复制
Preprocessing library for quipper-utils-0.9.0.0..
Building library for quipper-utils-0.9.0.0..

...

[11 of 15] Compiling Quipper.Utils.Template.Lifting ( Quipper/Utils/Template/Lifting.hs, dist/build/Quipper/Utils/Template/Lifting.o, dist/build/Quipper/Utils/Template/Lifting.dyn_o )

Quipper/Utils/Template/Lifting.hs:252:28: error:
    • Couldn't match type ‘Maybe TH.Exp’ with ‘TH.Exp’
      Expected: [TH.Exp]
        Actual: [Maybe TH.Exp]
    • In the second argument of ‘mapM’, namely ‘exps’
      In a stmt of a 'do' block: exps' <- mapM expTHtoAST exps
      In the expression:
        do exps' <- mapM expTHtoAST exps
           return (TupE exps')
    |
252 |   exps' <- mapM expTHtoAST exps
    |                            ^^^^

Quipper/Utils/Template/Lifting.hs:417:20: error:
    • Couldn't match type ‘TH.Exp’ with ‘Maybe TH.Exp’
      Expected: [Maybe TH.Exp]
        Actual: [TH.Exp]
    • In the first argument of ‘TH.TupE’, namely ‘exps'’
      In the second argument of ‘($)’, namely ‘TH.TupE exps'’
      In a stmt of a 'do' block: return $ TH.TupE exps'
    |
417 |   return $ TH.TupE exps'
    |                    ^^^^^
cabal: Failed to build quipper-utils-0.9.0.0 (which is required by
quipper-0.9.0.0). See the build log above for details.
EN

回答 2

Stack Overflow用户

发布于 2021-06-11 19:06:07

我敢肯定Quipper套餐的限制太宽松了。在GHC 9.0.1中,模板Haskell有相当大的变化。并且template-haskell库的版本被绑定到您正在使用的GHC版本,所以您必须使用旧版本的GHC。我已经用GHC 8.8.4测试过了,它是有效的。

票数 0
EN

Stack Overflow用户

发布于 2021-10-14 06:01:54

尝试从这里安装8.6.5版本:https://www.haskell.org/platform/prior.html。我也有同样的问题,这对我很有效。

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

https://stackoverflow.com/questions/67822937

复制
相关文章

相似问题

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