尝试安装Quipper (quantum programming language for Haskell)时,抛出编译错误:
我的构建配置文件:-w ghc-9.0.1 -O1
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.发布于 2021-06-11 19:06:07
我敢肯定Quipper套餐的限制太宽松了。在GHC 9.0.1中,模板Haskell有相当大的变化。并且template-haskell库的版本被绑定到您正在使用的GHC版本,所以您必须使用旧版本的GHC。我已经用GHC 8.8.4测试过了,它是有效的。
发布于 2021-10-14 06:01:54
尝试从这里安装8.6.5版本:https://www.haskell.org/platform/prior.html。我也有同样的问题,这对我很有效。
https://stackoverflow.com/questions/67822937
复制相似问题