Hello, World Program is a basic Simple First program or application to code and learn any new programming language.

It just displays the hello world string to the console.

This post shows how to write a hello world application in Haskell Programming language.

Haskell Hello World Example

Open the editor of your choice

  • Create a text file name called helloworld.ml
  • add the below line of code
module Main where
main = putStrLn "Hello, World!"

main is the main function entry point to the Haskell program, It is defined in the module. putStrLn is a function that prints the string to console

Ho to run Haskell program using command line

ghc helloworld.hs

[1 of 1] Compiling Main ( helloworld.hs, helloworld.o ) Linking helloworld …