12月4日の学び

ファイルの読み書きは直感的にできる

ファイルの書き込み

Prelude> writeFile "test.txt" "Hello, Haskell!"

ファイルの読み込み

Prelude> let str = readFile "test.txt"
Prelude> str
"Hello, Haskell!"
Prelude> :t str
str :: IO String