The following Linux command(s) verify the installed version of the Haskell compiler.
ghc --version
On
2019-08-05 the output was as follows.
The Glorious Glasgow Haskell Compilation System, version 7.6.3
The file type of a
Haskell program file is
hs.
The following Linux command(s) create/edit a hello program in the your home directory using the nano text editor.
nano ~/hello.hs
Create the following program text in the editor that will output the text "Hello world"
main = putStrLn "Hello world"
To exit with save, remember to press
Ctrl-X, then "
y" (for yes) and
Enter to exit.
The following Linux command(s) run the program.
ghc -o hello ~/hello.hs
./hello
The output should be as follows.
Hello world