我正在尝试使用 Conduit Network,但无法编译此代码,因为它找不到数据构造函数:HostAny
安装了conduit-extra,所以我很困惑为什么找不到它?
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Conduit
import Data.Conduit.Network
serverApp :: AppData -> IO ()
serverApp d = do appSource d $$ appSink d
main :: IO()
main = runTCPServer (serverSettings 8900 HostAny) serverApp
这是 GHC 错误:
pez@devbox:~/dev$ runhaskell server.hs
server.hs:10:42: Not in scope: data constructor `HostAny'