iTranslated by AI
The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🔥
Hello World in Haskell
When installing with mise, add the plugin
mise plugin add ghc
mise install ghc
mise global ghc@9.10.1
For Homebrew, you can install it using GHCup
brew install ghcup
ghcup install ghc 9.10.1
Write the Hello World code
hello.hs
main = putStrLn "Hello World"
Run it
runghc hello.hs
The interactive shell can be started with ghci
ghci
ghci> "Hello World"
"Hello World"
ghci> :quit
Discussion