Getting started with the Haskell programming language
Some quotes from Wikipedia:
“Haskell is a standardized, general-purpose purely functional programming language…“
“The language continues to evolve rapidly, with the Glasgow Haskell Compiler (GHC) implementation representing the current de facto standard.“
“It is a purely functional language, which means that in general, functions in Haskell do not have side effects.“
“There is an active community around the language, and more than 2600 third-party open-source libraries and tools are available in the online package repository Hackage.“
Installation
sudo apt-get install haskell-platform
Hello, World! (compiled)
Create the file hello.hs:
main = putStrLn "Hello, World!"
Compile it:
ghc hello.hs -o hello
Run it with ./hello.
Hello, World! (interpreted)
#!/usr/bin/runghc main = putStrLn "Hello, World!"
Then “chmod u+x hello.hs” and “./hello.hs“.
Tutorials
There are tons of tutorials on the Web.
- Learn You a Haskell for Great Good! by Miran Lipovača is a fun introduction to the language. Get the PDF version here.
- Haskell in 5 steps (quick intro)
Links
- http://haskell.org (the HQ)
- Learn Haskell Fast and Hard (for Python programmers)