Hi, 

I am trying to read data from a file.
When I do-
ghci> contents <- readFile "file.txt"
ghci> words contents

Then everything works.

The same thing when done in a .hs file gives an IO String vs [String] error.

Why is that so?