ファイル全体を文字列に読み込んでから、関数を使用して文字列の行を取得したいと思いlinesます。私はこれらのコード行でそれをやろうとしています:
main = do
args <- getArgs
content <- readFile (args !! 0)
linesOfFiles <- lines content
しかし、広告をコンパイルすると次のエラーが発生します。失敗します。
Couldn't match expected type `IO t0' with actual type `[String]'
In the return type of a call of `lines'
In a stmt of a 'do' block: linesOfFiles <- lines content
readFile結果をコンテンツにバインドすることで、DataTypeになると思いましたStringが、なぜですか?