Remove some redundant parentheses
Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
Use expectP in deriving( Read )

Note [Use expectP]   in TcGenDeriv
~~~~~~~~~~~~~~~~~~
Note that we use
   expectP (Ident "T1")
rather than
   Ident "T1" <- lexP
The latter desugares to inline code for matching the Ident and the
string, and this can be very voluminous. The former is much more
compact.  Cf Trac #7258, although that also concerned non-linearity in
the occurrence analyser, a separate issue.
rename do_map_arrow as do_premap (no semantic change)
Make {-# UNPACK #-} work for type/data family invocations

This fixes most of Trac #3990.  Consider
  data family D a
  data instance D Double = CD Int Int
  data T = T {-# UNPACK #-} !(D Double)
Then we want the (D Double unpacked).

To do this we need to construct a suitable coercion, and it's much
safer to record that coercion in the interface file, lest the in-scope
instances differ somehow.  That in turn means elaborating the HsBang
type to include a coercion.

To do that I moved HsBang from BasicTypes to DataCon, which caused
quite a few minor knock-on changes.

Interface-file format has changed!

Still to do: need to do knot-tying to allow instances to take effect
within the same module.
Merge branch 'master' of http://darcs.haskell.org/ghc

Conflicts:
	compiler/basicTypes/MkId.lhs
	compiler/iface/IfaceSyn.lhs
A bit more tracing
Remember to zonk when taking free variables in simpl_top

Forgetting this meant that we were upating the same
meta-tyvar twice.  Fixes Trac #7525.
Merge branch 'master' of http://darcs.haskell.org/ghc
Comment typo only
Simplify the binder-swap transformation

The occurrence analyser implements the "binder-swap" transformation,
described in Note [Binder swap] in OccAnal. For some reason I had
implemeted an extremely complicated version, I believe intended to get
as much as possible done in single simplifier pass.  But it turned
out (Trac #7258) that the 'getProxies' bit of this complicated code
scaled rather non-linearly, and all by itself could consume half of
the entire compile time.

The patch dramatically simplifies the transformation, so that
we simply swizzle
     case x of y { I# v -> e }
to
     case x of y { I# v -> let x = y in e }

I can't see any reason not to do this

  * Compiler allocation for #7258 with 200 fields goes down by 25%
    and compile time by 20%

  * The nofib figures do not budge

  * Quite a bit of complicated code goes away
Add traceSmpl for simplifier tracing, now that the simplifier has the IO monad
Make combine-identical-alternatives work again (Trac #7360)

Move the "combine indentical alternatives" transformation *before*
simplifying the alternatives.  For example
     case x of y
        [] -> length y
        (_:_) -> length y }

If we look *post* simplification, since 'y' is used in the
alterantives, the case binders *might* be (see the keep_occ_info test
in Simplify.simplAlt); and hence the combination of the two
alteranatives does not happen.  But if we do it *pre* simplification
there is no problem.

This fixes Trac #7360.
Make the treatment of addAltUnfoldings handle casts

This minor refactoring re-attaches Note [Add unfolding for scrutinee].
It had become detached, which led me on a bit of a wild goose
chase.

While I was at it, I made the code work right for the case where
the scrutinee is of form (x |> co); I don't think this is an important
improvement.

I also make simplAlt unconditionally zap occurrence information on
case-alternative binders (see Note [Case alternative occ info]);
it was almost always being zapped and the additional complexity seems
not worth it.
Fix dictionaries for SingI.

This adds the missing coercions in the constructed evidence for SingI.
Previously we simply passed an integer or a string for the evidence,
which was not quite correct and causes errors when the core lint is
enabled.   This patch corrects this by inserting the necessary
coercions.
Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
Remove references to GHC 6.6 in docs
Fix typo in comment (Trac #7526)
Refactor the invariants for ClsInsts

We now have the invariant for a ClsInst that the is_tvs field
is always completely fresh type variables. See
Note [Template tyvars are fresh] in InstEnv.

(Previously we frehened them when extending the instance environment,
but that seems messier because it was an invariant only when the
ClsInst was in an InstEnv.  Moreover, there was an invariant that
thet tyvars of the DFunid in the ClsInst had to match, and I have
removed that invariant altogether; there is no need for it.)

Other changes I made at the same time:

 * Make is_tvs into a *list*, in the right order for the dfun type
   arguments.  This removes the wierd need for the dfun to have the
   same tyvars as the ClsInst template, an invariant I have always
   hated. The cost is that we need to make it a VarSet when matching.
   We could cache an is_tv_set instead.

 * Add a cached is_cls field to the ClsInst, to save fishing
   the Class out of the DFun.  (Renamed is_cls to is_cls_nm.)

 * Make tcSplitDFunTy return the dfun args, not just the *number*
   of dfun args

 * Make InstEnv.instanceHead return just the *head* of the
   instance declaration.  Add instanceSig to return the whole
   thing.
Comments and white space only