Get Started

Quick steps to get up and running with Haskell.

1 Download Haskell Stack

Chosen operating system: Linux

Run the following in your terminal:

$ wget -qO- | sh

Or for distribution-specific packages, choose your Linux distribution:

Or get more detailed info, more Linux distributions, etc.

With the Haskell Stack you get a comprehensive development environment for Haskell:

  • Stack: A project builder for multi-package Haskell projects.
  • GHC: A compiler and interpreter for Haskell programs.
  • Haddock: A documentation generator for Haskell packages.
  • And thousands of packages installed on demand.

2 Running Haskell programs

To quickly run a Haskell script:

  1. Copy the following content into a file called HelloWorld.hs:

    #!/usr/bin/env stack
    -- stack --install-ghc runghc
    main :: IO ()
    main = putStrLn "Hello World"
  2. Open up a terminal and run stack HelloWorld.hs.


Start on a proper Haskell package. Run the following in your terminal:

$ stack new new-project $ cd new-project $ stack build $ stack exec new-project-exe

You can now edit the source files in this directory (see the file src/Lib.hs), and rebuild and run the project with stack build and stack exec new-project-exe as above.

3 Next steps

Congratulations, you're setup to start writing Haskell code! We've broken down next steps into a few common workflows with Stack. If you're not sure where to start, we recommend reading them in order.