Haskell 向GHCI添加依赖项
我可以在GHCI中包含依赖项吗 如果正在运行cabal,请添加到.cabal文件Haskell 向GHCI添加依赖项,haskell,ghci,Haskell,Ghci,我可以在GHCI中包含依赖项吗 如果正在运行cabal,请添加到.cabal文件 build-depends: base >=4.7 && <4.8,http-conduit-downloader cabal repl不启动repl 更新2: c:\Users\Adrian\Google Drive\SparkSetup>cabal configure cabal: SparkSetup.cabal:19: Construct not suppor
build-depends: base >=4.7 && <4.8,http-conduit-downloader
cabal repl
不启动repl
更新2:
c:\Users\Adrian\Google Drive\SparkSetup>cabal configure
cabal: SparkSetup.cabal:19: Construct not supported at this position: F 19
"main-is" "SparkSetup.hs\nbuild-depends: base >=4.7 &&
<4.8,http-conduit-downloader\ndefault-language: Haskell2010"
更新4:
SparkSet.cabal:
-- Initial SparkSetup.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: SparkSetup
version: 0.1.0.0
-- synopsis:
-- description:
license: GPL-2
license-file: LICENSE
author: USER
maintainer: USER.COM
-- copyright:
-- category:
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
executable SparkSetup
main-is: SparkSetup.hs
-- other-modules:
-- other-extensions:
build-depends: base >=4.7 && <4.8,http-conduit-downloader
-- hs-source-dirs:
default-language: Haskell2010
似乎是缩进问题(\n也可能导致此问题)
但现在当我跑步时:
c:\Users\Adrian\Google Drive\SparkSetup>cabal install
Resolving dependencies...
Notice: installing into a sandbox located at C:\Users\Adrian\Google
Drive\SparkSetup\.cabal-sandbox
Configuring network-2.6.2.1...
Failed to install network-2.6.2.1
Last 10 lines of the build log ( C:\Users\Adrian\Google Drive\SparkSetup\.cabal-
sandbox\logs\network-2.6.2.1.log ):
[1 of 1] Compiling Main ( C:\Users\Adrian\AppData\Local\Temp\network
-2.6.2.1-10212\network-2.6.2.1\dist\dist-sandbox-8472864c\setup\setup.hs, C:\Use
rs\Adrian\AppData\Local\Temp\network-2.6.2.1-10212\network-2.6.2.1\dist\dist-san
dbox-8472864c\setup\Main.o )
Linking C:\Users\Adrian\AppData\Local\Temp\network-2.6.2.1-10212\network-2.6.2.1
\dist/dist-sandbox-8472864c\setup\setup.exe ...
Configuring network-2.6.2.1...
setup.exe: The package has a './configure' script. This requires a Unix
compatibility toolchain such as MinGW+MSYS or Cygwin.
cabal: Error: some packages failed to install:
HsOpenSSL-0.11.1.1 depends on network-2.6.2.1 which failed to install.
SparkSetup-0.1.0.0 depends on network-2.6.2.1 which failed to install.
connection-0.2.5 depends on network-2.6.2.1 which failed to install.
http-client-0.4.18.1 depends on network-2.6.2.1 which failed to install.
http-client-tls-0.2.2 depends on network-2.6.2.1 which failed to install.
http-conduit-2.1.7.1 depends on network-2.6.2.1 which failed to install.
http-conduit-downloader-1.0.25 depends on network-2.6.2.1 which failed to
install.
network-2.6.2.1 failed during the configure step. The exception was:
ExitFailure 1
socks-0.5.4 depends on network-2.6.2.1 which failed to install.
streaming-commons-0.1.12.1 depends on network-2.6.2.1 which failed to install.
tls-1.3.1 depends on network-2.6.2.1 which failed to install.
x509-validation-1.6.0 depends on network-2.6.2.1 which failed to install.
似乎http导管下载程序包也有问题?您使用的cabal和ghc版本是什么?也只是为了确定,您能否先运行
cabal configure
并将输出粘贴到此处?问题不在于cabal repl
或ghci
。SparkSetup.cabal
文件的第19行出现语法错误。错误为cabal:SparkSetup.cabal:19:Construct在此位置不受支持:F 19“main is”“SparkSetup.hs\n构建取决于:base>=4.7&&取决于最新的编辑:在Windows中构建网络
包有一些复杂之处。请参阅以获取建议,或者从最新版本开始,其中包括一个预构建的网络
,然后重新创建您的沙箱。您使用的是什么cabal和ghc版本?也只是为了确定,您能否先运行cabal configure
并将输出粘贴到此处?问题不在于cabal repl
或ghci
。SparkSetup.cabal
文件的第19行出现语法错误。错误为cabal:SparkSetup.cabal:19:Construct在此位置不受支持:F 19“main is”“SparkSetup.hs\n构建取决于:base>=4.7&&取决于最新的编辑:在Windows中构建网络
包有一些复杂之处。请参阅以获取建议,或者从最新的开始,其中包括一个预构建的网络
,然后重新创建沙盒。
-- Initial SparkSetup.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: SparkSetup
version: 0.1.0.0
-- synopsis:
-- description:
license: GPL-2
license-file: LICENSE
author: USER
maintainer: USER.COM
-- copyright:
-- category:
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
executable SparkSetup
main-is: SparkSetup.hs
-- other-modules:
-- other-extensions:
build-depends: base >=4.7 && <4.8,http-conduit-downloader
-- hs-source-dirs:
default-language: Haskell2010
-- Initial SparkSetup.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
name: SparkSetup
version: 0.1.0.0
-- synopsis:
-- description:
license: GPL-2
license-file: LICENSE
author: USER
maintainer: USER.COM
-- copyright:
-- category:
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
executable SparkSetup
main-is: SparkSetup.hs
-- other-modules:
-- other-extensions:
build-depends: base >=4.7 && <4.8,http-conduit-downloader
-- hs-source-dirs:
default-language: Haskell2010
c:\Users\Adrian\Google Drive\SparkSetup>cabal install
Resolving dependencies...
Notice: installing into a sandbox located at C:\Users\Adrian\Google
Drive\SparkSetup\.cabal-sandbox
Configuring network-2.6.2.1...
Failed to install network-2.6.2.1
Last 10 lines of the build log ( C:\Users\Adrian\Google Drive\SparkSetup\.cabal-
sandbox\logs\network-2.6.2.1.log ):
[1 of 1] Compiling Main ( C:\Users\Adrian\AppData\Local\Temp\network
-2.6.2.1-10212\network-2.6.2.1\dist\dist-sandbox-8472864c\setup\setup.hs, C:\Use
rs\Adrian\AppData\Local\Temp\network-2.6.2.1-10212\network-2.6.2.1\dist\dist-san
dbox-8472864c\setup\Main.o )
Linking C:\Users\Adrian\AppData\Local\Temp\network-2.6.2.1-10212\network-2.6.2.1
\dist/dist-sandbox-8472864c\setup\setup.exe ...
Configuring network-2.6.2.1...
setup.exe: The package has a './configure' script. This requires a Unix
compatibility toolchain such as MinGW+MSYS or Cygwin.
cabal: Error: some packages failed to install:
HsOpenSSL-0.11.1.1 depends on network-2.6.2.1 which failed to install.
SparkSetup-0.1.0.0 depends on network-2.6.2.1 which failed to install.
connection-0.2.5 depends on network-2.6.2.1 which failed to install.
http-client-0.4.18.1 depends on network-2.6.2.1 which failed to install.
http-client-tls-0.2.2 depends on network-2.6.2.1 which failed to install.
http-conduit-2.1.7.1 depends on network-2.6.2.1 which failed to install.
http-conduit-downloader-1.0.25 depends on network-2.6.2.1 which failed to
install.
network-2.6.2.1 failed during the configure step. The exception was:
ExitFailure 1
socks-0.5.4 depends on network-2.6.2.1 which failed to install.
streaming-commons-0.1.12.1 depends on network-2.6.2.1 which failed to install.
tls-1.3.1 depends on network-2.6.2.1 which failed to install.
x509-validation-1.6.0 depends on network-2.6.2.1 which failed to install.