Haskell http-conduit-1.9.6“没有用于(Read UTCTime)的实例”编译错误 [英] Haskell http-conduit-1.9.6 "No instance for (Read UTCTime)" compilation error
问题描述
我试图安装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(在沙箱中),我必须:
-
明确地添加依赖于network-uri的构建依赖于http-conduit.cabal
- p>在Network / HTTP / Conduit / Types.hs中,通过导入Data.Time替换导入的Data.Time.Clock b b
$ b
让我知道如果这不行。
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:
Explicitly add a dependency on network-uri in the build-depends of the http-conduit.cabal
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屋!