More allDistinctTyVars from TcDeriv to Type

Just a minor refactoring
In TcValidity.checkAmbiguity, skolemise kind vars that appear free in the kinds of type variables

This was shown up by Trac #9222.
Fix docs typo.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Refactor extension-bitmap in Lexer

This introduces an Enum type `ExtBits` for the currently used 32 flags
and introduces a type-synonym `ExtsBitmap` for representing a set over
`ExtBits`. While at it, the current `Int` was replaced by `Word` to
have the compiler catch any missed use-sites.

This will make it easy to swap the `Word`-representation of `ExtsBitmap`
by something different, such as e.g. a `Word64`

Test Plan: successful validate

Differential Revision: https://phabricator.haskell.org/D23
Make -fno-write-interface to all modes of GHC, not just -fno-code.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Revert "Make -fno-write-interface to all modes of GHC, not just -fno-code."

This reverts commit 05120ecd95b2ebf9b096a95304793cd78be9506e.
Comments only
Add -XBinaryLiterals language extension (re #9224)

Haskell2010 supports

- base-10 (prefix-less),
- base-8 (via `0[oO]`-prefix), and
- base-16 (via `0[xX]`-prefix) integer literals.

This commit adds syntax support for base-2 integer literals via the new `0[bB]`
prefix. The use of a `0b` prefix for indicating binary literals is known
from popular programming languages such as C++14, Perl, Python, Ruby, and Java.

This syntax extension is disabled by default and can be enabled via the
new `{-# LANGUAGE BinaryLiterals #-}` pragma and/or the new `-XBinaryLiterals`

This new extensions requires to upgrade the `ExtsBitmap` type from
`Word` to `Word64` as this adds a 33th flag which is not guaranteed to
fit into a `Word`.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>

Differential Revision: https://phabricator.haskell.org/D22
Minor updates to Backpack docs.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Whitespace only
Untabify and M-x whitespace cleanup
Fix #9245 by always checking hi-boot for consistency if we find one.

Summary:
What this fix does is reorder how we look for hi-boot files: we
unconditionally check for an hi-boot file, and if we don't find one, we
check the import graph to see if there was circularity.  This is as
opposed to the previous scheme (check for circularity, then load hi-boot
file).

This costs us an extra file system access every typecheck, which
is not the best.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: Validate and check for compiler regressions in nofib

Reviewers: simonpj, austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D30
Simplify .gitignore files

It's a bit confusing to have .gitignore files spread all over the
filesystem. This commit tries to consolidate those into one .gitignore
file per component. Moreover, we try to describe files to be ignored which
happen to have a common identifying pattern by glob patterns.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Add BUILD_DPH variable to GHC build-system

Now that the `libraries/dph` submodule is checked out always we need
a different way to disable building DPH to save compile-time while
developing GHC.

This commit adds a new YES/NO Make variable `BUILD_DPH` that can be used
inside mk/build.mk to control whether to build libraries/dph or not.
The default setting is `BUILD_DPH=YES` (via `mk/config.mk.in`).

This also changes `validate`'s flag `--no-dph` to explicitly disable DPH
for the current validation run.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>

Test Plan: successful validates with `--fast --no-dph`

Differential Revision: https://phabricator.haskell.org/D31
Tyop in comment
Update Cabal to BinaryLiterals-aware 1.20 version

In 1c0b5fdc9f2b6ea8166cc565383d4cd20432343c (re #9224) `BinaryLiterals`
was temporarily added to T4437's `expectedGhcOnlyExtensions` list. This
can now reverted as Cabal has been made aware of `BinaryLiterals`
(see haskell/cabal#1970 and haskell/cabal#1972).

updates Cabal submodule

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Expect test failure for T8832 on 32bit (re #8832)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Update 32bit & 64bit performance numbers

Some numbers have decreased but the haddock numbers have generally
increased noticeable again (see also last update in 970e5d99fb658b73)

This updates all numbers I noticed in the "fast" test-mode, *except* for
the T9203 test-case on 32bit, which needs more investigation before
bumping due to its significant increase:

  bytes allocated value is too high:
      Expected    bytes allocated: 50000000 +/-5%
      Lower bound bytes allocated: 47500000
      Upper bound bytes allocated: 52500000
      Actual      bytes allocated: 85093548
  *** unexpected failure for T9203(normal)
Promote TcNullaryTC and TcCoercible to fast tests

I'm wondering whether it's sensible to omit so many typecheck testcases from
the default validate test target. As for instance, TcNullaryTC has been failing
since its introduction in c63a465011b99eeafbb957074e54c2e6bbf751d9 (re #8993) and
it seems to have gone unnoticed so far.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Factor-out the `OverlapMode` from `OverlapFlag`.

This seems a bit cleaner conceptually because the overlap mode and running
in safety mode are quite orthogonal.

More pragmatically, it also makes it possible to use `OverlapMode` to let
programmers pick the overlap mode for individual instances.