how to read a file's content to a string?

Ashley Yakeley ashley@semantic.org
Tue, 5 Mar 2002 16:03:31 -0800


At 2002-03-05 14:43, Zhe Fu wrote:

>content :: FilePath -> String 
>content f = readFile f

You have the wrong type signature for 'content'. This should solve it:

  content :: FilePath -> IO String 
  content f = readFile f

Of course, you'll need to change whatever uses 'content'.

-- 
Ashley Yakeley, Seattle WA