Usage of the command line tools

The HaskellCLI package, containing the Haskell for Mac command line tools, installs the following executables in /usr/local/lib/HaskellCLI-<VERSION>/bin/

  • ghc (Glasgow Haskell Compiler),
  • ghci (Glasgow Haskell Compiler REPL),
  • ghc-pkg (Glasgow Haskell Compiler package manager),
  • runghc & runhaskell (Haskell interpreter to run Haskell scripts & programs without compiling them),
  • haddock (Haskell documentation generator),
  • hpc (Haskell coverage checker tool),
  • hsc2hs (lightweight C to Haskell library bridging generator),
  • hp2ps (heap profile to PostScript converter),
  • cabal (Cabal build tool and package manager),
  • cpphs (C-style pre-processor),
  • alex (lexer generator), and
  • happy (parser generator).

The tools ghc, ghci, runghc, and ghc-pkg come in a second versioned variant as well. For example, for GHC 7.10.3, we have ghc and ghc-7.10.3.

Optionally, you can install all tools into /usr/local/bin from the "Command Line" tools tab of the Haskell for Mac app preferences.

Library flavours

As of Version 1.1 of Haskell for Mac and its command line tools, only dynamic libraries and dynamically linked executables are supported. There is not yet support for static linking nor is profiling supported.

Supported packages and package dependencies

Each version of Haskell for Mac and its command line tools is based on a specific version of LTS Haskell. To determine which version of LTS Haskell is used by your installation of Haskell for Mac, see the "About" window in the "Haskell" menu of Haskell for Mac. (In Haskell for Mac 1.4, we use LTS Haskell 6.29.)

When you use cabal install; to install a new package from the online package repository, the installed package and all its dependencies (that are not already bundled with Haskell for Mac) will be downloaded from Stackage Server using the package version that is contained in the LTS Haskell version matching your version of Haskell for Mac. Similarly, if you build and install a local package (possibly one authored by yourself), it is important that all package dependencies can be satisfied from that version of LTS Haskell.

If you need packages not contained in LTS Haskell, you can use cabal command line options to specify other repositories, but this may lead to conflicts that are beyond the scope of what Haskell for Mac support will be able to assist with. Moreover, some packages from LTS Haskell may depend on non-Haskell libraries or tools that may need to be installed separately. Please keep in mind that all software in LTS Haskell is provided by third parties and, while we will endeavour to help wherever possible, we may need to refer you to the maintainers of the respective packages.

Build tools and package executables

All executables installed by packages (such as c2hs) are installed into ~/Library/Haskell/bin. Subsequent package installs will automatically pick them up at this location. However, if you want to manually invoke these executables, you either need to specify the full path to the executable or add ~/Library/Haskell/bin to your PATH environment variable.

Interaction with other Haskell installations 

By default, there is no interaction with other Haskell installations. You you choose to link the the command line tools into /usr/local/bin, other executable in that directory may be overwritten.

Haskell for Mac and its command line tools will always use their own Haskell package database. Packages installed by other tool chains will be ignored and the package database of other tool chains will not be modified.

Have more questions? Submit a request


  • 1

    Hi, you might want to include haddock in the list of executables being installed by Haskell for Mac (see above).

  • 0
    Manuel Chakravarty

    @kidomine, you are very right. It's fixed now. Thank you for pointing out this oversight.

  • 0
    Eric Zoerner

    How would I install layers-0.1 (which is not in the LTS)?

Please sign in to leave a comment.
Powered by Zendesk