Haskell:http-wget在windows中挂起我的程序

时间:2013-03-15 17:14:51

标签: windows haskell cygwin wget

我在两台电脑上试过这个。以下是我的步骤:

  1. 在cygwin上安装wget
  2. cabal install http-wget
  3. 升级我的PATH环境变量以包含C:\ cygwin \ bin
  4. 打开WinGHCi并输入:
  5. 来自提示:

    GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
    Loading package ghc-prim ... linking ... done.
    Loading package integer-gmp ... linking ... done.
    Loading package base ... linking ... done.
    Prelude> :m + Network.HTTP.Wget
    Prelude Network.HTTP.Wget> wget "http://www.google.com" [] []
    Loading package bytestring-0.9.2.1 ... linking ... done.
    Loading package Win32-2.2.2.0 ... linking ... done.
    Loading package filepath-1.3.0.0 ... linking ... done.
    Loading package old-locale-1.0.0.4 ... linking ... done.
    Loading package old-time-1.1.0.0 ... linking ... done.
    Loading package directory-1.1.0.2 ... linking ... done.
    Loading package process-1.1.0.1 ... linking ... done.
    Loading package failure-0.1.2 ... linking ... done.
    Loading package transformers-0.2.2.0 ... linking ... done.
    Loading package http-wget-0.6.2.3 ... linking ... done.
    

    此行之后没有其他事情发生。该命令未完成。它只是永远挂起。我是Haskell的新手,不知道如何调试这个问题。

    $ ghc --version
    The Glorious Glasgow Haskell Compilation System, version 7.4.2
    

    我在cygwin提示符下尝试了wget命令,它按预期工作。

    这适用于WinGHCi:

    let getGoogle = do (_, Just hout, _, _) <- createProcess (proc "wget" ["-q", "www.google.com", "-O", "-"]){ std_out = CreatePipe }; hGetContents hout
    

    我是从一位名叫mcstar的绅士的IRC那里得到的。

0 个答案:

没有答案