Save this in a file named "hello1.hs".
main = putStrLn "hello world"
To run it, enter this at a shell prompt:
$ runghc hello1.hs
Or, enter this at a GHCi prompt:
Prelude> :load hello1.hs *Main> main
Just for the kick, here is another version, "hello2.hs"