Add missing kind-check for tcEqType on forall-types

This wasn't showing up as a bug, but it was definitely wrong.

(cherry picked from commit 74894e0bc405247092e865b9541f5f18d26aa015)
relnotes: GND is not -XSafe compatible.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 73cab206e0f211b75cb6fd62ab9b6ca8ae0950f2)
Implicit parameters should not be allowed in class and instance declarations

Trac #8912 pointed out that GHC 7.4 and 7.6 have omitted this test, although
7.2 and earlier had it.  This patch puts the test back in, and refactors a
little.

(cherry picked from commit a8b7b28cdb98d14c6fb43d5ad3293fd4a5c1f8b4)

Conflicts:
	testsuite/tests/typecheck/should_fail/all.T
For equalities with incompatible kinds, new IrredCan goes in the inert set, not work list

This change makes the code for canIrred markedly simpler (and more efficient)
See Note [Equalities with incompatible kinds].

I don't think there was really a bug here, but I came across it when
fixing Trac #8913

(cherry picked from commit c89c57e3b72a8f3de9f35e1bd6e0f70d2b18a941)
Flattener preserves synonyms, rewriteEvidence can drop buggy "optimisation"

There was a special case in rewriteEvidence, looking like:
  = return (Just (if ctEvPred old_ev `tcEqType` new_pred
                  then old_ev
                  else old_ev { ctev_pred = new_pred }))

But this was wrong: old_pred and new_pred might differ in the kind
of a TyVar occurrence, in which case tcEqType would not notice,
but we really, really want new_pred.  This caused Trac #8913.

I solved this by dropping the whole test, and instead making
the flattener preserve type synonyms. This was easy because
TcEvidence has TcTyConAppCo which (unlike) Coercion, handles
synonyms.

(cherry picked from commit 6ae678e31a5fdd3b0bd1f8613fe164012bb630f4)
Implement ordering comparisons for type-level naturals and symbols.

This is done with two built-in type families: `CmpNat and `CmpSymbol`.
Both of these return a promoted `Ordering` type (EQ, LT, or GT).

(cherry picked from commit 5e4bdb5fc5e741522cbb787731422da3f12aa398)
Use the correct callClobberedRegs on Windows/x64 (#8834)

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit c4eeacdfdf4578eb6e75bbf2e067bfe70ec94ab0)
rts: remove unused functions, fix validate on OS X

After a toolchain update, Clang is no longer appreciative of the fact
these are unused, thanks to -Werror during validate.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 7ef3f0d6dbd54d9e58fb6ab1f2db322bc8fac37a)
Temporarily fight off build bogons on OS X

Right now there's a bug with Clang that prevents 'cabal haddock' from
working nicely. But there's an easy fix for now.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 52c6dc970272437aa83a936fc1fe63977fa6178d)
Bump haddock.base test-case resource limits due to haddock-2.14.2

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

We now do role inference on stupid datatype contexts, allowing a
lightweight role annotation syntax.

(cherry picked from commit d468cd376ffc02cf9f4755275a316be914c482be)
windows: Fix #8870

This bumps the amount of default reserved and committed stack for GHC
executables to 8mb, to work around #8870. A proper fix should happen in
7.8.2

See note [Windows stack usage] in SysTools for the details.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit f0af58df4b5d5ace750e7d7a91ad471284c1b429)
Make sure that polykinded Typeable is defaultable (Trac #8931)

(cherry picked from commit 791f4fa24dd6929ab2e55c9f8b870d8078337427)
Test Trac #8931

(cherry picked from commit 8bf8ce1e7cb1b97a1f18ec6f5552e339808ffba9)
Fix copy/paste error (#8937)

(cherry picked from commit 59b9b067b030d551f9b42423b50770c661c9d86c)
Fix desguaring of bang patterns (Trac #8952)

A palpable bug, although one that will rarely bite

(cherry picked from commit 3671d0027329804a31a628a5bee355e0640a2045)
Revert "Revert ad15c2, which causes Windows seg-faults (Trac #8834)"

This reverts commit a79613a75c7da0d3d225850382f0f578a07113b5.

(cherry picked from commit c6c86789c95462216a3167d7b98b202a5bf4c0b2)
Require PatternSynonyms language flag when encountering a use of pattern synonym
(#8961)

(cherry picked from commit 8f831ec578d22419788542290e164c50524d90f6)
T8958: fix stderr

Signed-off-by: Austin Seipp <austin@well-typed.com>
users_guide: note -XPatternSynonyms is required for use sites

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit b059dcc81e9c4097b5f04f85e1ac33586c494110)