HfT 01 02 03 04 05 06     01 02 03 04 05 06 07 08 09 10 11 12 13 14     ←    

Hello

module Main where

Every Haskell program has a Main module. For now, our programs will consist only of a Main module.

Every Haskell program has a main function, where execution begins.

Our first line declares the type of main; we use the standard type for a function that generates output. Our second line defines main as a call to the function print, which outputs a Haskell value.

main  IO ()
main = print "hello"

This program generates the following output. Quotes are included, because the value is output as it would be written in a Haskell program.

"hello"

Main.hs