In accordance with tradition, we begin with a tiny example program that prints a friendly greeting.
This is the complete source for this program.
= putStrLn "hello world"main
Put the code into a file named
runhaskell command to run the program.
$ runhaskell hello-world.hshello world
A Haskell program can also be compiled. For this we use GHC (the Glasgow Haskell Compiler).
$ ghc hello-world.hs $ lshello-world hello-world.hi hello-world.hs hello-world.o
Then we can execute the
$ ./hello-worldhello world