[英]How do I get the contents of a URI that uses the `file` protocol in Haskell?
如何可以寫類型的函數Text -> IO (Maybe ByteString)
,其中的參數Text
是使用一個URI file
的協議,例如file://foo/bar
?
您可以使用包下載來實現您想要的。 但請注意,類型簽名與您想要的略有不同:
openURI :: String -> IO (Either String ByteString)
第一個 String 參數表示 url ,可以是FTP
、 HTTP
或文件協議。 請注意,此包不支持HTTPS
協議。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.