Mirror of the Glasgow Haskell Compiler. Patches are best submitted to GHC's Phabricator (https://phabricator.haskell.org/), bugs and feature-requests are best filed to GHC's Trac (https://ghc.haskell.org/trac/ghc), or sent to the mailing list (ghc-devs@haskell.org). First time contributors are encouraged to get started by just sending a Pull Req…
Haskell C Makefile Terra C++ Logos Other
Switch branches/tags
Pull request Compare This branch is 855 commits behind ghc:master.
Latest commit b0ed07f Aug 17, 2017
bgamari Allow TcDerivInfer to compile with GHC 8.0.1
As of ed7a830 this module uses
MultiWayIf, the parsing behavior of which changed in 8.0.2 due
to #10807. Reformat the code so that it compiles under both 8.0.1 and

Test Plan: Validate bootstrapping with 8.0.1

Reviewers: austin

Subscribers: rwbarton, thomie, RyanGlScott

GHC Trac Issues: #14130

Differential Revision: https://phabricator.haskell.org/D3863
Failed to load latest commit information.
.arc-linters linters/check-cpp: Demote #if lints to warnings Apr 21, 2017
bindisttest Rework CC/CC_STAGE0 handling in `configure.ac` Apr 16, 2016
compiler Allow TcDerivInfer to compile with GHC 8.0.1 Aug 16, 2017
distrib Preserve HaskellHaveRTSLinker in bindist Jul 23, 2017
docs Point to FunDeps documentation on Haskell wiki Aug 15, 2017
driver Implement split-sections support for windows. Jul 7, 2017
ghc Drop GHC 7.10 compatibility Aug 1, 2017
includes Speed up compilation of profiling stubs Aug 16, 2017
inplace Testsuite: suggest quoting $(TEST_HC) Oct 30, 2015
iserv Typo in output of remote slave startup [merge cand] Jun 6, 2017
libffi-tarballs @ ec37a68 Revert "libffi via submodule" May 11, 2017
libffi Revert "libffi via submodule" May 11, 2017
libraries Bump mtl, parsec, text submodules (again) Aug 16, 2017
mk Enable building Cabal with parsec Aug 1, 2017
nofib @ 63ce82a Bump nofib submodule Aug 15, 2017
rts Speed up compilation of profiling stubs Aug 16, 2017
rules Enable building Cabal with parsec Aug 1, 2017
testsuite Don't drop GHCi-defined functions with -fobject-code enabled Aug 15, 2017
utils Fix #14060 by more conservatively annotating TH-reified types Aug 15, 2017
.arcconfig arcconfig: Set project ruleset to use master merge-base by default Jul 20, 2017
.arclint Use python3 for linters Dec 23, 2016
.gitignore Add the bootstrapping/ dir to .gitignore Aug 2, 2017
.gitmodules Add .gitmodules entries for text, parsec, mtl submodules Aug 1, 2017
.mailmap mailmap: Add Douglas Wilson May 11, 2017
.travis.yml Travis: Add dependency on python3 Dec 2, 2016
ANNOUNCE ANNOUNCE: Mention powerpc code generator Jan 15, 2016
HACKING.md HACKING: Update for Phabricator patch workflow Apr 4, 2017
INSTALL.md Revert "Rewrite boot in Python" May 26, 2017
LICENSE Reorganisation of the source tree Apr 7, 2006
MAKEHELP.md Revert "Rewrite boot in Python" May 26, 2017
Makefile Add “BINARY_DIST_DIR” to Makefile Jul 28, 2017
README.md Fix markdown for new GitHub Flavored Markdown May 4, 2017
Vagrantfile vagrant: move files around Jul 20, 2014
aclocal.m4 configure: Ensure that user's LD setting is respected Jul 28, 2017
boot Revert "Rewrite boot in Python" May 26, 2017
config.guess Update autoconf scripts Jul 23, 2017
config.sub Update autoconf scripts from correct source May 12, 2017
configure.ac Enable building Cabal with parsec Aug 1, 2017
ghc.mk Enable building Cabal with parsec Aug 1, 2017
install-sh Update aux files `config.{guess,sub}` and `install-sh` Nov 7, 2013
packages Bump mtl, parsec, text submodules Aug 15, 2017
settings.in distrib/configure: Fail if we can't detect machine's word size Jul 12, 2017
validate testsuite: Produce JUnit output Jul 28, 2017


The Glasgow Haskell Compiler

Build Status

This is the source tree for GHC, a compiler and interactive environment for the Haskell functional programming language.

For more information, visit GHC's web site.

Information for developers of GHC can be found on the GHC Trac.

Getting the Source

There are two ways to get a source tree:

  1. Download source tarballs

Download the GHC source distribution:


which contains GHC itself and the "boot" libraries.

  1. Check out the source code from git

    $ git clone --recursive git://git.haskell.org/ghc.git

Note: cloning GHC from Github requires a special setup. See Getting a GHC repository from Github.

See the GHC team's working conventions regarding how to contribute a patch to GHC. First time contributors are encouraged to get started by just sending a Pull Request.

Building & Installing

For full information on building GHC, see the GHC Building Guide. Here follows a summary - if you get into trouble, the Building Guide has all the answers.

Before building GHC you may need to install some other tools and libraries. See, Setting up your system for building GHC.

NB. In particular, you need GHC installed in order to build GHC, because the compiler is itself written in Haskell. You also need Happy, Alex, and Cabal. For instructions on how to port GHC to a new platform, see the GHC Building Guide.

For building library documentation, you'll need Haddock. To build the compiler documentation, you need Sphinx and Xelatex (only for PDF output).

Quick start: the following gives you a default build:

$ ./boot
$ ./configure
$ make         # can also say 'make -jX' for X number of jobs
$ make install

On Windows, you need an extra repository containing some build tools. These can be downloaded for you by configure. This only needs to be done once by running:

$ ./configure --enable-tarballs-autodownload

(NB: Do you have multiple cores? Be sure to tell that to make! This can save you hours of build time depending on your system configuration, and is almost always a win regardless of how many cores you have. As a simple rule, you should have about N+1 jobs, where N is the amount of cores you have.)

The ./boot step is only necessary if this is a tree checked out from git. For source distributions downloaded from GHC's web site, this step has already been performed.

These steps give you the default build, which includes everything optimised and built in various ways (eg. profiling libs are built). It can take a long time. To customise the build, see the file HACKING.md.

Filing bugs and feature requests

If you've encountered what you believe is a bug in GHC, or you'd like to propose a feature request, please let us know! Submit a ticket in our bug tracker and we'll be sure to look into it. Remember: Filing a bug is the best way to make sure your issue isn't lost over time, so please feel free.

If you're an active user of GHC, you may also be interested in joining the glasgow-haskell-users mailing list, where developers and GHC users discuss various topics and hang out.

Hacking & Developing GHC

Once you've filed a bug, maybe you'd like to fix it yourself? That would be great, and we'd surely love your company! If you're looking to hack on GHC, check out the guidelines in the HACKING.md file in this directory - they'll get you up to speed quickly.

Contributors & Acknowledgements

GHC in its current form wouldn't exist without the hard work of its many contributors. Over time, it has grown to include the efforts and research of many institutions, highly talented people, and groups from around the world. We'd like to thank them all, and invite you to join!