A Simple Hello World Program in Haskell


title: Hello World Program

A Simple Hello World Program in Haskell

main :: IO () main = do putStrLn "Hello World"

Hello World using function composition

hello :: String hello = "Hello World" printer :: String -> IO () printer = putStrLn . show main :: IO () main = printer hello

Function compositions are a better way to write multiple nested functions in Haskell. In the above example, putStrLn.show is equivalent to (putStrLn (show)).

This article needs improvement. You can help improve this article. You can also write similar articles and help the community.