Enable -funbox-small-strict-fields by default

The flag shows no real impact on nofib benchmarks and GHC itself,
which is expected given the small number of strict but not already
unpacked fields in the source of these programs. However, the flag
allows us to omit most of the UNPACK pragmas that are so common in
source code today.
extended ticky to also track "let"s that are not conventional closures

This includes selector, ap, and constructor thunks. They are still
guarded by the -ticky-dyn-thk flag.

(This is 024df664b600a with a small bug fix.)
Don't suppress foralls in the RHS of a type synonym definition!

Fixes Trac #7872
Improve documentation of kind polymorphism
Make isPredTy not use typeKind

The pretty-printer uses isPredTy to decide whether to use "=>" or "->",
and typeKind crashes on ill-kinded types. But it's really unhelpful for
the pretty-printer to crash on an ill-kinded type, because then you can't
see it!
Eliminate (given) flatten-skolems in favour of user type variables

See Note [Eliminate flat-skols].  IT wasn't exactly wrong before
the the error messages are deeply strange.
Fix kind quantification (again)

We simply weren't quantifying kind variables at the points we
were claiming.  In paritcular, in
     forall (a:k). blah
we quantify the 'k' around the 'forall a', provided k isn't
already in scope
In doTopReactDict, try lookup even if fundeps work

Previously we looked for fundeps, and if any fired we
didn't try to solve the constraint.  But that's wrong
(see Note [Weird fundeps]).  Now I solve first and only
if that fails try fundeps.  Code is neater too.

Fixes Trac #7875
Improve error message for existential newtypes
Do not duplicate work in SpecConstr (fix Trac #7865)

This is a bad bug, if a rare one.
See Note [Work-free values only in environment].

Thanks to Amos Robinson for finding it.
Fix/update SayAnnNames plugin example code.
Reorganize mk/build.mk.sample a little.

People are probably more likely to notice some useful variables
if they're located closer to the top (like V=0 and stage=2.)

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Allow deriving Typeable for more tycons
Update the name cache when creating new names via DeriveGeneric

New external top-level names were being created but the name cache
wasn't being populated, leading to #7878.

Signed-off-by: Jose Pedro Magalhaes <jpm@cs.ox.ac.uk>
Treat foreign imported things in CMM as being in this package

They used to be treated as being in an exnternal package, which went
wrong on Windows (it tried to call them via an imp wrapper, rather
than calling them directly).
Fix dynamically linked GHC on Windows

This is a rather ugly hack to fix dynamically linked GHC on Windows.

If GHC is linked with -threaded, then it links against libHSrts_thr.
But if base is linked against libHSrts, then both end up getting
loaded, and things go wrong. We therefore link the libraries that
link against the RTS with the same RTS flags that we link GHC with.
Fix the name of libffi

On Windows, we need to keep the DLL called libffi-6.dll (rather than
libffi.dll) or Windows can't find it.
Generate dependencies for .cmm files properly
rts_checkSchedStatus: exit the thread, not the process, when Interrupted

This means that when the process is shutting down, if we have calls to
foreign exports in progress, they get forcibly terminated as before,
but now they only shut down the calling thread rather than the whole
process (with -threaded).

This came up in a discussion started by Akio Takano on ghc-users.
Make -fno-flat-cache use a dynamic, rather than static, flag