haskell写入文件代码
代码语言:haskell
代码描述:haskell写入文件代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
import Foreign.Marshal.Array import Control.Exception import Data.Int import System.IO main = do let d1 = "hello\nhaskell\n" writeFile "/tmp/dat1" d1 bracket (openBinaryFile "/tmp/dat2" WriteMode) (\handle -> hClose handle) $ \handle -> do let d2 = [115, 111, 109, 101, 10] :: [Int8] p <- newArray d2 .........完整代码请登录后点击上方下载按钮下载查看
网友评论0