2016-05-30から1日間の記事一覧
do記法でのファイル読み込み import System.IO printFile :: String -> IO() printFile path = do handle <- openFile path ReadMode contents <- hGetContents handle putStrLn contents hClose handle 型を確認する。 > :t openFile openFile :: FilePath …
do記法でのファイル読み込み import System.IO printFile :: String -> IO() printFile path = do handle <- openFile path ReadMode contents <- hGetContents handle putStrLn contents hClose handle 型を確認する。 > :t openFile openFile :: FilePath …