为什么这么简单的
代码不工作?
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L
main :: IO ()
main = simpleHttp "http://www.dir.bg/" >>= L.putStr
导致以下错误:
TestConduit.exe: InternalIOException getAddrInfo: does not exist
(error 10093)
您必须使用
套接字来初始化
套接字.
喜欢这个:
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L
import Network (withSocketsDo)
main :: IO ()
main = withSocketsDo
$simpleHttp "http://www.dir.bg/" >>= L.putStr