Hello World Program in Haskell
main :: IO ()
main = putStrLn "Hello World!"
The main
function comprises one expression,
putStrLn "Hello World!"
which has the side effect
of printing out the string argument to the stdout.
If you compile and run this program, for example, using ghc, then you will get the following output:
Hello World!
What's Next
If you are interested in learning Haskell programming, then go ahead and set up a development environment.
- Next Step: Haskell development environment setup
C C++ C# Clojure Crystal D Dart Erlang F# Go Java Javascript Julia Kotlin Lua Python Rust Scala Swift Typescript