Haskell http-conduit-1.9.6“没有用于(Read UTCTime)的实例”编译错误 [英] Haskell http-conduit-1.9.6 "No instance for (Read UTCTime)" compilation error

查看:130
本文介绍了Haskell http-conduit-1.9.6“没有用于(Read UTCTime)的实例”编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装http-conduit-1.9.6(我的Haskell应用程序需要该版本),而我的cabal install http-conduit-1.9.6给了我以下错误:



构建http-conduit-1.9.6 ...

预处理库http-conduit-1.9.6 ...

[1 of 12 ]编译Network.HTTP.Conduit.Util(网络/ HTTP / Conduit / Util.hs,dist / build / Network / HTTP / Conduit / Util.o)

[2 of 12] Compiling Network.HTTP .Conduit.ConnInfo(Network / HTTP / Conduit / ConnInfo.hs,dist / build / Network / HTTP / Conduit / ConnInfo.o)

[3 of 12] Compiling Network.HTTP.Conduit.Types( Network / HTTP / Conduit / Types.hs,dist / build / Network / HTTP / Conduit / Types.o)

:13:

 没有用于(读取UTC时间)的实例
来自数据类型声明的派生子句
可能的修正:
为(读取UTCTime)
添加实例声明或使用独立的派生实例声明
所以你可以自己指定实例上下文
当为(读取Cookie)派生实例时

无法安装http-conduit-1.9.6

cabal:错误:某些程序包未能安装:

http-conduit-1.9.6在构建阶段失败。例外是:

ExitFailure 1



我的工作平台是Ubuntu 14.04和cabal 1.20
谢谢。

解决方案

要构建http-conduit-1.9.6(在沙箱中),我必须:


  1. 明确地添加依赖于network-uri的构建依赖于http-conduit.cabal


  2. p>在Network / HTTP / Conduit / Types.hs中,通过导入Data.Time替换导入的Data.Time.Clock b b
    $ b

    在正确的轨道上: https://github.com/haskell/time/issues/7


让我知道如果这不行。


I'm trying to install http-conduit-1.9.6 (my Haskell application needs that version), and my "cabal install http-conduit-1.9.6" gives me the following error:

Building http-conduit-1.9.6...
Preprocessing library http-conduit-1.9.6...
[ 1 of 12] Compiling Network.HTTP.Conduit.Util ( Network/HTTP/Conduit/Util.hs, dist/build/Network/HTTP/Conduit/Util.o )
[ 2 of 12] Compiling Network.HTTP.Conduit.ConnInfo ( Network/HTTP/Conduit/ConnInfo.hs, dist/build/Network/HTTP/Conduit/ConnInfo.o )
[ 3 of 12] Compiling Network.HTTP.Conduit.Types ( Network/HTTP/Conduit/Types.hs, dist/build/Network/HTTP/Conduit/Types.o )

Network/HTTP/Conduit/Types.hs:239:13:

No instance for (Read UTCTime)  
  arising from the 'deriving' clause of a data type declaration  
Possible fix:
  add an instance declaration for (Read UTCTime)
  or use a standalone 'deriving instance' declaration,
       so you can specify the instance context yourself
When deriving the instance for (Read Cookie)

Failed to install http-conduit-1.9.6
cabal: Error: some packages failed to install:
http-conduit-1.9.6 failed during the building phase. The exception was:
ExitFailure 1

My work platform is Ubuntu 14.04 and cabal 1.20 Thanks.

解决方案

To build http-conduit-1.9.6 (in a sandbox), I've had to:

  1. Explicitly add a dependency on network-uri in the build-depends of the http-conduit.cabal

  2. In Network/HTTP/Conduit/Types.hs, replace the import Data.Time.Clock by import Data.Time

    (this issue in the time package put me on the right track: https://github.com/haskell/time/issues/7)

Let me know if that doesn't do it.

这篇关于Haskell http-conduit-1.9.6“没有用于(Read UTCTime)的实例”编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆