首页 文章

haskell堆栈不会安装日期

提问于
浏览
0

在一个独立模块中,我使用通过cabal安装的日期包http://hackage.haskell.org/package/dates,它工作正常 . 但是当我尝试使用堆栈从这个模块中创建一个小包时出现了一个问题 . 日期包在依赖项中被适当地列出,但它们都不起作用 . 当我尝试在项目沙箱中使用堆栈手动安装包时,我收到以下错误 . 同时我可以在堆栈沙箱外安装这个包装,没有问题 .

沙盒中的版本: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
   |          ^^^^^^^^^^^^^^^

1 回答

  • 1

    最后,我需要将stack.yaml文件中的解析器更改为旧版本(lts-8.24),这将强制使用ghc-8.0.2 . 运用

    stack --resolver ghc-8.0.2 setup / build

    我没有阻止堆栈使用最新的ghc版本

    stack exec blah-exe

    这引发了冲突 .

相关问题