Haskell 哈斯克尔·斯塔克获胜';安装日期

Haskell 哈斯克尔·斯塔克获胜';安装日期,haskell,haskell-stack,Haskell,Haskell Stack,在一个独立的模块中,我使用了通过cabal安装的dates软件包,它运行良好。但是,当我尝试使用堆栈从这个模块中生成一个小包时,出现了一个问题。dates包在dependencies和all中适当列出,但它不起作用。当我尝试在项目沙盒中使用堆栈手动安装包时,我得到以下错误。同时,我可以在堆栈沙箱外安装这个软件包,而不会出现问题 沙盒中的版本: ghc-8.4.3 堆栈-1.7.1 系统版本: ghc-8.0.2 cabal-1.24.0.2(汇编1.24.2.0) 错误消息: Configuri

在一个独立的模块中,我使用了通过cabal安装的dates软件包,它运行良好。但是,当我尝试使用堆栈从这个模块中生成一个小包时,出现了一个问题。dates包在dependencies和all中适当列出,但它不起作用。当我尝试在项目沙盒中使用堆栈手动安装包时,我得到以下错误。同时,我可以在堆栈沙箱外安装这个软件包,而不会出现问题

沙盒中的版本: ghc-8.4.3 堆栈-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。使用

堆栈--解析器ghc-8.0.2安装/生成

没有阻止stack使用最新的ghc版本

stack exec blah exe


这引发了冲突

这完全是ghc不同版本的结果。较新版本的ghc使用了base的一个版本,使半群成为幺半群的超类。