haskell - haskell 堆栈不会安装日期
问题描述
在一个独立的模块中,我使用通过 cabal 安装的日期包http://hackage.haskell.org/package/dates ,它工作正常。但是当我尝试使用堆栈从这个模块中制作一个小包时出现了一个问题。日期包在依赖项中适当列出,但它不起作用。当我尝试在项目沙箱中使用堆栈手动安装包时,出现以下错误。同时,我可以在堆栈沙箱外使用 cabal 安装此软件包而不会出现问题。
沙盒中的版本:ghc-8.4.3 stack-1.7.1
系统版本:ghc-8.0.2 cabal-1.24.0.2(编译 1.24.2.0)
错误信息:
Configuring dates-0.2.2.1...
Preprocessing library for dates-0.2.2.1..
Building library for dates-0.2.2.1..
[1 of 4] Compiling Data.Dates.Internal ( Data/Dates/Internal.hs, .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/Data/Dates/Internal.o )
[2 of 4] Compiling Data.Dates.Types ( Data/Dates/Types.hs, .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/Data/Dates/Types.o )
/tmp/stack16211/dates-0.2.2.1/Data/Dates/Types.hs:62:10: error:
• No instance for (Semigroup DateTime)
arising from the superclasses of an instance declaration
• In the instance declaration for ‘Monoid DateTime’
|
62 | instance Monoid DateTime where
| ^^^^^^^^^^^^^^^
解决方案
最后,我需要将 stack.yaml 文件中的解析器更改为旧版本(lts-8.24),这将强制使用 ghc-8.0.2。使用
堆栈 --resolver ghc-8.0.2 设置/构建
当我这样做时,并没有阻止堆栈使用最新的 ghc 版本
堆栈执行 blah-exe
这引发了冲突。
推荐阅读
- r - 尝试在 R 中创建骰子游戏但功能未运行
- sql - SQL中连接的交换性
- haskell - 理解 Comonad 的 <$$>
- android - 为什么在 Android Studio 3.3 中 Google 登录时找不到 default_web_client_id
- python-2.7 - OperationalError 仅允许作为表达式一部分的 SELECT 的单个结果
- c - C 中指向字符串管理的指针:替换字符串中的特定字符
- dependency-injection - 使用依赖注入设置 saga 时出现 Masstransit 错误
- r - locator() 如何与图形设备一起使用?
- active-directory - AD 域名迁移到新的 AD 域
- java - 如何让游戏出现一系列硬币?