Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Haskell


1. Haskell

2. CentOS installation
The following Linux command(s) install Haskell.
sudo yum -y install haskell-platform


3. Verify the version
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


4. Hello world in Haskell
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


5. End of page