haskell中的日期时间包 - 当前错误,无法找到模拟

时间:2015-06-09 17:24:38

标签: haskell

当我安装软件包datetime时,我收到了一个错误:

$ cabal install datetime
Resolving dependencies...
Configuring datetime-0.2.1...
Building datetime-0.2.1...
Preprocessing library datetime-0.2.1...
[1 of 1] Compiling Data.DateTime    ( src/Data/DateTime.lhs, dist/dist-sandbox-5f6496af/build/Data/DateTime.o )

src/Data/DateTime.lhs:139:31:
    Ambiguous occurrence ‘defaultTimeLocale’
    It could refer to either ‘Data.Time.Format.defaultTimeLocale’,
                             imported from ‘Data.Time.Format’ at src/Data/DateTime.lhs:8:3-25
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.defaultTimeLocale’,
                             imported from ‘System.Locale’ at src/Data/DateTime.lhs:12:3-22

src/Data/DateTime.lhs:142:29:
    Ambiguous occurrence ‘defaultTimeLocale’
    It could refer to either ‘Data.Time.Format.defaultTimeLocale’,
                             imported from ‘Data.Time.Format’ at src/Data/DateTime.lhs:8:3-25
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.defaultTimeLocale’,
                             imported from ‘System.Locale’ at src/Data/DateTime.lhs:12:3-22

src/Data/DateTime.lhs:144:15:
    Ambiguous occurrence ‘iso8601DateFormat’
    It could refer to either ‘Data.Time.Format.iso8601DateFormat’,
                             imported from ‘Data.Time.Format’ at src/Data/DateTime.lhs:8:3-25
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.iso8601DateFormat’,
                             imported from ‘System.Locale’ at src/Data/DateTime.lhs:12:3-22
Failed to install datetime-0.2.1
cabal: Error: some packages failed to install:
datetime-0.2.1 failed during the building phase. The exception was:
ExitFailure 1

由于它在github上的存储库不再存在,你有什么建议我:以某种方式修复错误或选择另一个包?我试图找到另一个发现,但不能。我需要的是能够使用日期时间。

1 个答案:

答案 0 :(得分:1)

幸运的是Stack Builders编写了一个与最新编译器兼容的版本。您可以找到来源here。正如repo doc所说,它更新为Hackage,名称为datetime-sb,因此您可以安装它并在您的依赖项中使用它,就像原始库一样,只需用datetime代替datetime-sb您需要在何处引用包名称

编辑:

最终Stack Builders took over维护datetime包。任何人都不应该再出现这个问题