ghc.git
6 years agoRefactored by Simon Marlow's suggestion
Evan Hauck [Thu, 28 Nov 2013 16:58:50 +0000 (11:58 -0500)] 
Refactored by Simon Marlow's suggestion

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoMade ghc -e have a nonzero exit code upon failure (Trac #7962 )
khyperia [Thu, 28 Nov 2013 04:30:59 +0000 (23:30 -0500)] 
Made ghc -e have a nonzero exit code upon failure (Trac #7962 )

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoUse new flushExec implementation on all operating systems (#8562)
Christopher Rodrigues [Sat, 30 Nov 2013 05:05:50 +0000 (23:05 -0600)] 
Use new flushExec implementation on all operating systems (#8562)

An earlier patch fixes a bug in flushExec on linux only.  This
patch uses the fixed code on all operating systems.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoUpdate and deduplicate the comments on CAF management (#8590)
Patrick Palka [Wed, 4 Dec 2013 15:38:47 +0000 (10:38 -0500)] 
Update and deduplicate the comments on CAF management (#8590)

6 years agoMove the allocation of CAF blackholes into 'newCAF' (#8590)
Patrick Palka [Mon, 2 Dec 2013 02:17:43 +0000 (21:17 -0500)] 
Move the allocation of CAF blackholes into 'newCAF' (#8590)

We now do the allocation of the blackhole indirection closure inside the
RTS procedure 'newCAF' instead of generating the allocation code inline
in the closure body of each CAF.  This slightly decreases code size in
modules with a lot of CAFs.

As a result of this change, for example, the size of DynFlags.o drops by
~60KB and HsExpr.o by ~100KB.

6 years agoRemove code that generates FunDep error message context
Joachim Breitner [Wed, 4 Dec 2013 15:47:49 +0000 (15:47 +0000)] 
Remove code that generates FunDep error message context

as it seems that this code is now dead (due to
[Dropping derived constraints]) (See #8592)

6 years agoUntab ClosureTypes.h and ClosureFlags.c
Patrick Palka [Tue, 3 Dec 2013 15:27:14 +0000 (10:27 -0500)] 
Untab ClosureTypes.h and ClosureFlags.c

6 years agoComments only
Simon Peyton Jones [Wed, 4 Dec 2013 13:40:43 +0000 (13:40 +0000)] 
Comments only

6 years agoImprove ASSERT
Simon Peyton Jones [Mon, 2 Dec 2013 16:49:57 +0000 (16:49 +0000)] 
Improve ASSERT

6 years agoComments only
Simon Peyton Jones [Mon, 2 Dec 2013 16:49:22 +0000 (16:49 +0000)] 
Comments only

6 years agoFix note reference [WildCard binders]
Joachim Breitner [Wed, 4 Dec 2013 10:07:09 +0000 (10:07 +0000)] 
Fix note reference [WildCard binders]

6 years agoMore detailed error message when GND fails
Joachim Breitner [Wed, 4 Dec 2013 08:42:13 +0000 (08:42 +0000)] 
More detailed error message when GND fails

we now print the precise class method, with types, where the coercion
failed.

6 years agoExport getHscEnv from HscMain
Edsko de Vries [Sun, 1 Dec 2013 13:55:07 +0000 (13:55 +0000)] 
Export getHscEnv from HscMain

6 years agoMask async exceptions in forkM_
Edsko de Vries [Thu, 28 Nov 2013 16:38:26 +0000 (16:38 +0000)] 
Mask async exceptions in forkM_

See #8006 for the reason why. This is not a fix as such; more of a workaround.

6 years agoElaborate "deriving" error messages
Joachim Breitner [Tue, 3 Dec 2013 10:42:55 +0000 (10:42 +0000)] 
Elaborate "deriving" error messages

If "deriving (C)" fails, it will now, if possible, indicate which
particular field of which constructor has caused the failure. (This
fixes #8576)

6 years agoRefactor: Origin of inferred Thetas
Joachim Breitner [Mon, 2 Dec 2013 19:16:08 +0000 (19:16 +0000)] 
Refactor: Origin of inferred Thetas

When doing non-standalone deriving, annotate each individual
unsimplified constraint with its own CtOrigin. This is just the
refactoring, so the CtOrigin is still CtDeriv in each case.

6 years agoSome popular typos in comments
Gabor Greif [Mon, 2 Dec 2013 22:05:43 +0000 (23:05 +0100)] 
Some popular typos in comments

6 years agoNote [HyperStr and Use demands]
Joachim Breitner [Mon, 2 Dec 2013 18:03:52 +0000 (18:03 +0000)] 
Note [HyperStr and Use demands]

This note is a summary of an explanation by SPJ to me.

6 years agoMove FunDeps to typecheck
Joachim Breitner [Mon, 2 Dec 2013 17:53:23 +0000 (17:53 +0000)] 
Move FunDeps to typecheck

That’s where all its users are...

6 years agoFix location of spliced-in role annotations.
Richard Eisenberg [Mon, 2 Dec 2013 18:02:08 +0000 (13:02 -0500)] 
Fix location of spliced-in role annotations.

6 years agoRejig rejigConRes & friends, doing role checks in a second pass.
Richard Eisenberg [Sat, 30 Nov 2013 21:05:47 +0000 (16:05 -0500)] 
Rejig rejigConRes & friends, doing role checks in a second pass.

This commit is just a refactoring, intended to make the use of
rejigConRes (which sorts out the return types of GADT-like constructors)
less delicate. The idea is that, if we perform role checking in a
second top-level pass, we can use checkValidDataCon to check for
valid return types. Previously, checking roles would force the
rejigConRes thunk before we knew that rejigConRes was safe to call!

6 years agoRemove dead code orphaned by implementing GND with `coerce`.
Richard Eisenberg [Tue, 26 Nov 2013 14:52:12 +0000 (09:52 -0500)] 
Remove dead code orphaned by implementing GND with `coerce`.

6 years agoMore links to [Coercible Instances]
Joachim Breitner [Mon, 2 Dec 2013 11:05:31 +0000 (11:05 +0000)] 
More links to [Coercible Instances]

6 years agoHandle Coercible (forall a. t) (forall a. t2) in TcInteract
Joachim Breitner [Mon, 2 Dec 2013 11:01:36 +0000 (11:01 +0000)] 
Handle Coercible (forall a. t) (forall a. t2) in TcInteract

6 years agoBind monadic stuff in getCoercibleInst locally, not via parameters
Joachim Breitner [Mon, 2 Dec 2013 10:56:31 +0000 (10:56 +0000)] 
Bind monadic stuff in getCoercibleInst locally, not via parameters

6 years agoRefactor deferTcSForAllEq: Do not bind, but return EvTerm
Joachim Breitner [Mon, 2 Dec 2013 10:12:38 +0000 (10:12 +0000)] 
Refactor deferTcSForAllEq: Do not bind, but return EvTerm

6 years agoPrint nicer error message for Coercible errors
Joachim Breitner [Mon, 2 Dec 2013 10:01:56 +0000 (10:01 +0000)] 
Print nicer error message for Coercible errors

It now reads

   Could not coerce from ‛S a’ to ‛S (NT a)’

and does not mention Coercible any more (as discussed in #8567).

6 years agoWith GND, report Coercible errors earliy
Joachim Breitner [Mon, 2 Dec 2013 09:45:12 +0000 (09:45 +0000)] 
With GND, report Coercible errors earliy

just like other type errors occurring during deriving.

6 years agoTcDeriv: s/isomorphism/coercible
Joachim Breitner [Mon, 2 Dec 2013 09:22:23 +0000 (09:22 +0000)] 
TcDeriv: s/isomorphism/coercible

in comments and function names, to use less names for the same thing.

6 years agoRevert "Respect the ordering of -package directives"
Patrick Palka [Mon, 2 Dec 2013 02:37:32 +0000 (21:37 -0500)] 
Revert "Respect the ordering of -package directives"

This commit was accidentally pushed.

This reverts commit 574ccfa231ca05d03d1da9d31e5bc81e74cc5e1e.

6 years agoRespect the ordering of -package directives
Patrick Palka [Tue, 26 Nov 2013 16:46:59 +0000 (11:46 -0500)] 
Respect the ordering of -package directives

6 years agoMove the LDV code below the self-loop label (#8275)
Patrick Palka [Sun, 1 Dec 2013 17:47:33 +0000 (12:47 -0500)] 
Move the LDV code below the self-loop label (#8275)

6 years agoDon't explicitly refer to nodeReg in ldvEnterClosure
Patrick Palka [Sun, 1 Dec 2013 17:44:14 +0000 (12:44 -0500)] 
Don't explicitly refer to nodeReg in ldvEnterClosure

6 years agoDocument solution to #8275
Jan Stolarek [Sun, 1 Dec 2013 10:28:50 +0000 (11:28 +0100)] 
Document solution to #8275

6 years agoFix loopification with profiling and enable it by default (#8275)
Patrick Palka [Fri, 29 Nov 2013 18:40:42 +0000 (13:40 -0500)] 
Fix loopification with profiling and enable it by default (#8275)

6 years agoFix documentation of FlexibleContexts (#8574)
Krzysztof Gogolewski [Sat, 30 Nov 2013 15:50:40 +0000 (16:50 +0100)] 
Fix documentation of FlexibleContexts (#8574)

6 years agoUpdate "stolen syntax" section (#8575)
Krzysztof Gogolewski [Sat, 30 Nov 2013 12:51:43 +0000 (13:51 +0100)] 
Update "stolen syntax" section (#8575)

6 years agoCall busy_wait_nop() in the spin-wait loop in shutdown_gc_threads()
Patrick Palka [Sat, 30 Nov 2013 01:01:27 +0000 (20:01 -0500)] 
Call busy_wait_nop() in the spin-wait loop in shutdown_gc_threads()

6 years agoUpdate "stolen syntax" section (#8575)
Krzysztof Gogolewski [Fri, 29 Nov 2013 21:41:31 +0000 (22:41 +0100)] 
Update "stolen syntax" section (#8575)

Thanks to aavogt

6 years agoMinor fix to example GHC plugin in the documentation
Joachim Breitner [Fri, 29 Nov 2013 18:44:31 +0000 (18:44 +0000)] 
Minor fix to example GHC plugin in the documentation

6 years agoUpdate Notes for Coercible
Joachim Breitner [Fri, 29 Nov 2013 09:28:53 +0000 (09:28 +0000)] 
Update Notes for Coercible

6 years agoRemove whitespace between macro identifiers and `(`
Herbert Valerio Riedel [Fri, 29 Nov 2013 08:00:57 +0000 (09:00 +0100)] 
Remove whitespace between macro identifiers and `(`

This is a kludge to workaround Clang's CPP lacking traditional-mode CPP

(This was reported by Kazu Yamamoto)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoFail (rather than addErr) if you use a bogus field in a pattern
Simon Peyton Jones [Thu, 28 Nov 2013 17:56:53 +0000 (17:56 +0000)] 
Fail (rather than addErr) if you use a bogus field in a pattern

This fixes Trac #8570

6 years agoMore faff to get GHCi's top-level environment right
Simon Peyton Jones [Tue, 26 Nov 2013 10:47:16 +0000 (10:47 +0000)] 
More faff to get GHCi's top-level environment right

This fixes #8540 (again), and simplifies matters a bit more. In
particular, I got rid of ic_sys_vars altogether.  Mostly they can just
go in ic_tythings, apart from dfuns, which are readily gettable from
the instances anyway.

See documentation in Note [Initialising the type environment for GHCi]
in TcEnv.

6 years agoFix the deugger (fixing Trac #8557)
Simon Peyton Jones [Mon, 25 Nov 2013 15:07:25 +0000 (15:07 +0000)] 
Fix the deugger (fixing Trac #8557)

The runtime debugger (which has not received any love from anyone
for many years) looks wrong to me; it was failing to instantiate the
outer foralls of a variable when called from :force, which calls
cvObtainTermFromId, which calls cvObtainTerm

I simplified the code too.  But I'm flaky on how this debugger stuff
is really supposed to work, so I'm partly guessing.  Tests pass though.

6 years agoRefactor handleRunStatus some more, add comments and tidy up formatting
Simon Marlow [Thu, 28 Nov 2013 12:03:26 +0000 (12:03 +0000)] 
Refactor handleRunStatus some more, add comments and tidy up formatting

I liked the idea of combining traceRunStatus and handleRunStatus, but
I think we lost a bit of clarity where traceRunStatus wants to fall
back to handleRunStatus when the breakpoint is enabled.  So I
refactored it a bit more.

6 years ago-ddump-cmm: don't dump the proc point stage if we didn't do anything
Simon Marlow [Thu, 28 Nov 2013 10:55:48 +0000 (10:55 +0000)] 
-ddump-cmm: don't dump the proc point stage if we didn't do anything

6 years agoComments on slow-call-shortcutting
Simon Marlow [Thu, 28 Nov 2013 10:55:26 +0000 (10:55 +0000)] 
Comments on slow-call-shortcutting

6 years agoFix up shortcut for slow calls
Patrick Palka [Wed, 27 Nov 2013 14:04:25 +0000 (09:04 -0500)] 
Fix up shortcut for slow calls

6 years agoImplement shortcuts for slow calls (#6084)
Simon Marlow [Thu, 28 Nov 2013 09:43:58 +0000 (09:43 +0000)] 
Implement shortcuts for slow calls (#6084)

6 years agoEvCast needs to take a representational coercion
Joachim Breitner [Thu, 28 Nov 2013 12:07:14 +0000 (12:07 +0000)] 
EvCast needs to take a representational coercion

as the coercions for type literals are of that role.

6 years agoComments only
Simon Peyton Jones [Thu, 28 Nov 2013 11:58:35 +0000 (11:58 +0000)] 
Comments only

6 years agoCoercible for impredicative types
Joachim Breitner [Wed, 27 Nov 2013 17:19:20 +0000 (17:19 +0000)] 
Coercible for impredicative types

using deferTcSForAllEq, just like for ~ types, during canonicalization

6 years agoGet rid of EvCoercible
Joachim Breitner [Wed, 27 Nov 2013 16:15:46 +0000 (16:15 +0000)] 
Get rid of EvCoercible

and use EvCoercion to describe the evidence for Coercible instances.

6 years agoBeginnings of removing EvCoercible
Joachim Breitner [Wed, 27 Nov 2013 14:21:43 +0000 (14:21 +0000)] 
Beginnings of removing EvCoercible

6 years agoRoleify TcCoercion
Joachim Breitner [Wed, 27 Nov 2013 14:21:39 +0000 (14:21 +0000)] 
Roleify TcCoercion

Previously, TcCoercion were only used to represent boxed Nominal
coercions. In order to also talk about boxed Representational coercions
in the type checker, we add Roles to TcCoercion. Again, we closely
mirror Coercion.

The roles are verified by a few assertions, and at the latest after
conversion to Coercion. I have put my trust in the comprehensiveness of
the testsuite here, but any role error after desugaring popping up now
might be caused by this refactoring.

6 years agoRemove unused liftTcCoSubstWith
Joachim Breitner [Wed, 27 Nov 2013 14:26:33 +0000 (14:26 +0000)] 
Remove unused liftTcCoSubstWith

6 years agoAdd role-checking ASSERT to mkCast
Joachim Breitner [Wed, 27 Nov 2013 10:33:56 +0000 (10:33 +0000)] 
Add role-checking ASSERT to mkCast

6 years agoComment only
Gabor Greif [Wed, 27 Nov 2013 12:43:35 +0000 (13:43 +0100)] 
Comment only

6 years agoComment only
Gabor Greif [Tue, 26 Nov 2013 14:11:39 +0000 (15:11 +0100)] 
Comment only

6 years agoRejigger flushExec implementation (#8562, #8561)
Austin Seipp [Tue, 26 Nov 2013 09:31:30 +0000 (03:31 -0600)] 
Rejigger flushExec implementation (#8562, #8561)

Instead, just don't do anything on x86/amd64, and on !x86, use either A)
__clear_cache from libgcc, or B) sys_icache_invalidate for OS X (and
iOS.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoghc.mk: one module name per line
Dr. ERDI Gergo [Thu, 21 Nov 2013 05:20:53 +0000 (13:20 +0800)] 
ghc.mk: one module name per line

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoTypos in comments
Gabor Greif [Tue, 26 Nov 2013 22:18:07 +0000 (23:18 +0100)] 
Typos in comments

6 years agoTypos in comments in TcEvidence
Joachim Breitner [Tue, 26 Nov 2013 16:43:28 +0000 (16:43 +0000)] 
Typos in comments in TcEvidence

6 years agoIn toHsType, filter out kind variables
Joachim Breitner [Mon, 25 Nov 2013 18:16:29 +0000 (18:16 +0000)] 
In toHsType, filter out kind variables

(This fixes #8563)

6 years agoAnother raft of Template Haskell clean-up
Simon Peyton Jones [Mon, 25 Nov 2013 16:58:28 +0000 (16:58 +0000)] 
Another raft of Template Haskell clean-up

The handling of typed and untyped brackets was extremely convoluted,
partly because of the evolutionary history.  I've tidied it all up.

See Note [How brackets and nested splices are handled] in TcSplice
for the full story

Main changes:

 * Untyped brackets: after the renamer, HsRnBracketOut carries
   PendingRnSplices for splices in untyped brackets.  In the
   typechecker, these pending splices are typechecked quite
   straigtforwardly, with no ps_var nonsense.

 * Typed brackets: after the renamer typed brackest still look
   like HsBracket. The type checker does the ps_var thing.

 * In TcRnTypes.ThStage, the Brack constructor, we distinguish
   the renaming from typehecking pending-stuff.  Much more
   perspicuous!

 * The "typed" flag is in HsSpliceE, not in HsSplice, because
   only expressions can be typed.  Patterns, types, declarations
   cannot.

There is further improvement to be done to make the handling of
declaration splices more uniform.

6 years agoUpdate to core-spec documentation.
Richard Eisenberg [Fri, 22 Nov 2013 22:27:32 +0000 (17:27 -0500)] 
Update to core-spec documentation.

This update includes some wibbles to make Co_TyConAppCo clearer,
as well as the introduction of forms for AxiomRuleCo.

6 years agoMention that the user has to import GHC.Exts for Constraint
Joachim Breitner [Sun, 24 Nov 2013 19:38:08 +0000 (19:38 +0000)] 
Mention that the user has to import GHC.Exts for Constraint

(required judging from confusion on #haskell right now.)

6 years agoReplace (State# RealWorld) with Void# where we just want a 0-bit value
Simon Peyton Jones [Fri, 22 Nov 2013 15:23:22 +0000 (15:23 +0000)] 
Replace (State# RealWorld) with Void# where we just want a 0-bit value

We were re-using the super-magical "state token" type (which has
VoidRep and is zero bits wide) for situations in which we simply want
to lambda-abstract over a zero-bit argument. For example, join points:

   case (case x of { True -> e1; False -> e2 }) of
      Red  -> f1
      Blue -> True

==>

  let $j1 = \voidArg::Void# -> f1
  in
  case x of
    True -> case e1 of
              Red -> $j1 void
              Blue -> True
    False -> case e2 of
              Red -> $j1 void
              Blue -> True

This patch introduces

   * The new primitive type GHC.Prim.Void#, with PrimRep = VoidRep

   * A new global Id GHC.Prim.voidPrimId :: Void#.
     This has no binding because the code generator drops it,
     but is used as an argument (eg in the call of $j1)

   * A new local Id, MkId.voidArgId, which can be lambda-bound
     when you need to lambda-abstract over it.

and uses them throughout.

Now the State# thing is used only when we need state!

6 years agoMove isVoidRep, isGcPtrRep to TyCon to join primRepSizeW etc
Simon Peyton Jones [Fri, 22 Nov 2013 15:05:39 +0000 (15:05 +0000)] 
Move isVoidRep, isGcPtrRep to TyCon to join primRepSizeW etc

This is just a modest refactoring

6 years agoUntabify and trailing white space
Simon Peyton Jones [Fri, 22 Nov 2013 15:04:19 +0000 (15:04 +0000)] 
Untabify and trailing white space

6 years agoAdd a missing case to Lint's understanding of empty cases
Simon Peyton Jones [Fri, 22 Nov 2013 15:03:15 +0000 (15:03 +0000)] 
Add a missing case to Lint's understanding of empty cases

   case x:Int# of {}

is OK

6 years agoUse bindLocalNamesFV in rn_inst_info
Joachim Breitner [Fri, 22 Nov 2013 13:40:34 +0000 (13:40 +0000)] 
Use bindLocalNamesFV in rn_inst_info

6 years agoUse newTyConInstRhs in coerce’d GND
Joachim Breitner [Fri, 22 Nov 2013 11:16:55 +0000 (11:16 +0000)] 
Use newTyConInstRhs in coerce’d GND

6 years agoImplement GeneralizedNewtypeDeriving in terms of `coerce`.
Richard Eisenberg [Mon, 11 Nov 2013 18:40:44 +0000 (13:40 -0500)] 
Implement GeneralizedNewtypeDeriving in terms of `coerce`.

6 years agoExtend Coercible to newtype instances
Joachim Breitner [Fri, 22 Nov 2013 10:15:01 +0000 (10:15 +0000)] 
Extend Coercible to newtype instances

This fixes: #8548

6 years agoPrevent recursive Coercible dictionaries
Joachim Breitner [Wed, 20 Nov 2013 14:09:08 +0000 (14:09 +0000)] 
Prevent recursive Coercible dictionaries

6 years agoAdd ctLoc = ctev_loc . cc_ev
Joachim Breitner [Fri, 22 Nov 2013 08:38:10 +0000 (08:38 +0000)] 
Add ctLoc = ctev_loc . cc_ev

6 years agoLarge refactor: Move CtLoc field from Ct to CtEvidence
Joachim Breitner [Thu, 21 Nov 2013 16:40:42 +0000 (16:40 +0000)] 
Large refactor: Move CtLoc field from Ct to CtEvidence

6 years agoAdd -ftype-function-stack to set type function stack depth
Joachim Breitner [Wed, 20 Nov 2013 10:24:52 +0000 (10:24 +0000)] 
Add -ftype-function-stack to set type function stack depth

6 years agoSeparate SubGoalDepthCounters (constraints and typ fun applications)
Joachim Breitner [Wed, 20 Nov 2013 10:04:15 +0000 (10:04 +0000)] 
Separate SubGoalDepthCounters (constraints and typ fun applications)

6 years agoMake SubGoalDepth a type of its own
Joachim Breitner [Wed, 20 Nov 2013 09:24:27 +0000 (09:24 +0000)] 
Make SubGoalDepth a type of its own

In preparation of counting type function applications and constraint
resolving separately.

6 years agoWibble to RnSplice (really belongs with b7f35733)
Simon Peyton Jones [Fri, 22 Nov 2013 09:58:42 +0000 (09:58 +0000)] 
Wibble to RnSplice (really belongs with b7f35733)

6 years agoRefactor TcSplice.tcBracket a bit
Simon Peyton Jones [Fri, 22 Nov 2013 09:41:02 +0000 (09:41 +0000)] 
Refactor TcSplice.tcBracket a bit

The way that untyped brackets are typechecked is still grotesquely
indirect, but I'll sort that out in a subsequent patch

6 years agoClarify what is in ic_tythings, and refactor TcRnDriver.setInteractiveContext
Simon Peyton Jones [Fri, 22 Nov 2013 09:40:10 +0000 (09:40 +0000)] 
Clarify what is in ic_tythings, and refactor TcRnDriver.setInteractiveContext

Previously there was a ton of cruft to do wtih "visible ids" in
setInteractiveContext, but I made it all a lot simpler by providing
a way to add to the typecheckers list of "global type variables",
via TcEnv.tcExtendGlobalTyVars.  This is much nicer.

6 years agoA raft of changes driven by Trac #8540
Simon Peyton Jones [Fri, 22 Nov 2013 09:24:54 +0000 (09:24 +0000)] 
A raft of changes driven by Trac #8540

The root cause of #8450 is that the new Template Haskell story, with
the renamer doing more of the work of Template Haskell, wasn't dealing
correctly with the keepAlive problem.  Consider
    g = ..blah...
    f = [| g |]
Then f's RHS refers to g's name but not to g, so g was being discarded
as dead code.

Fixing this sucked me into a deep swamp of understanding how all the moving
parts of hte new Template Haskell fit together, leading to a large collection
of related changes and better documentation.  Specifically:

* Instead of putting the TH level of a binder in the LocalRdrEnv, there
  is now a separate field
      tcl_th_bndrs :: NameEnv (TopLevelFlag, ThLevel)
  in the TcLclEnv, which records for each binder
     a) whether it is syntactically a top-level binder or not
     b) its TH level
  This deals uniformly with top-level and non-top-level binders, which was
  previously dealt with via greviously-delicate meddling with Internal and
  External Names.  Much better.

* As a result I could remove the tct_level field of ATcId.

* There are consequential changes in TcEnv too, which must also extend the
  level bindings.  Again, more clarity.

  I renamed TcEnv.tcExtendTcTyThingEnv to tcExtendKindEnv2, since it's only used
  during kind inference, for (AThing kind) and APromotionErr; and that is
  relevant to whether we want to extend the tcl_th_bndrs field (no).

* I de-crufted the code in RnEnv.extendGlobalRdrEnv, by getting rid of the
  qual_gre code which said "Seems like 5 times as much work as it deserves!".
  Instead, RdrName.pickGREs makes the Internal names shadow External ones.

* I moved the checkThLocalName cross-stage test to finishHsVar; previously
  we weren't doing the test at all in the OpApp case!

* Quite a few changes (shortening the code) in the cross-stage checking code
  in TcExpr and RnSplice, notably to move the keepAlive call to the renamer

One leftover piece:

* In TcEnv I removed tcExtendGhciEnv and refactored
  tcExtendGlobalTyVars; this is really related to the next commit, but
  it was too hard to disentangle.

6 years agoRefactor traceRunStatus/handleRunStatus
Simon Peyton Jones [Fri, 22 Nov 2013 08:30:41 +0000 (08:30 +0000)] 
Refactor traceRunStatus/handleRunStatus

No change in behaviour, but I combined these two functions, and I think
the result is a good deal clearer

6 years agoImprove pretty-printing of pending splices
Simon Peyton Jones [Fri, 22 Nov 2013 07:54:18 +0000 (07:54 +0000)] 
Improve pretty-printing of pending splices

6 years agoFix type-equality in the type checker (fixes Trac #8553)
Simon Peyton Jones [Fri, 22 Nov 2013 15:48:02 +0000 (15:48 +0000)] 
Fix type-equality in the type checker (fixes Trac #8553)

For horrible reasons (Note [Comparison with OpenTypeKind] in Type), the
function Type.eqType currently equates OOpenKind with *.  This may or may
not be a good idea (it's certainly a revolting one) but it DOES NOT WORK
in the type checker, which *does* need to distinguish OpenKind and *.

Rather than solve the underlying problem (I have some ideas) I just
introduced a new, and very short, simple, straightforward function
TcType.tcEqType to do the job.

6 years agoPrint the correct name when complaining about SPECIALISE pragmas
Simon Peyton Jones [Fri, 22 Nov 2013 15:30:30 +0000 (15:30 +0000)] 
Print the correct name when complaining about SPECIALISE pragmas

Fixes Trac #8537

6 years agoAdd suggestion of -XNegativeLiterals
Simon Peyton Jones [Fri, 22 Nov 2013 10:32:24 +0000 (10:32 +0000)] 
Add suggestion of -XNegativeLiterals

Based on a draft from Krzysztof Gogolewski.
Fixes Trac #8542

6 years agoBetter constraint-solver tracing
Simon Peyton Jones [Thu, 21 Nov 2013 10:28:56 +0000 (10:28 +0000)] 
Better constraint-solver tracing

6 years agoAlways re-summarise modules when -fforce-recomp is set
Patrick Palka [Thu, 14 Nov 2013 00:08:24 +0000 (19:08 -0500)] 
Always re-summarise modules when -fforce-recomp is set

Fixes #8526

6 years agoUntabify buffer.
Austin Seipp [Fri, 22 Nov 2013 14:20:42 +0000 (08:20 -0600)] 
Untabify buffer.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoExtend getPhysicalMemorySize to iOS (#8533)
Austin Seipp [Thu, 21 Nov 2013 22:48:24 +0000 (16:48 -0600)] 
Extend getPhysicalMemorySize to iOS (#8533)

Authored-by: Authored-by: Luke Iannini <lukexi@me.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoTemporarily lower unfolding threshold on Windows
Austin Seipp [Thu, 21 Nov 2013 22:39:41 +0000 (16:39 -0600)] 
Temporarily lower unfolding threshold on Windows

This is a very temporary, very unsatisfactory hack to fix #5987
(for now.)

The included comments essentially say it all: we lower the unfolding
threshold to minimize some amount of exported symbols from the GHC
stage2 DLL. I unfortunately had to lower it quite substantially for the
dynamic stage2 build to pass.

As of this writing, the DLL split between ghc.dll and ghc-0.dll is
something like 26,000 vs 63,000 exported symbols, respectively. So we're
still quite in danger of tripping it, but I think we will be OK at this
exact moment.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoComment on StgArrWords vs StgArrBytes
Arash Rouhani [Thu, 21 Nov 2013 13:17:45 +0000 (14:17 +0100)] 
Comment on StgArrWords vs StgArrBytes

See #8552

Signed-off-by: Arash Rouhani <rarash@student.chalmers.se>
Reviewed-by: Austin Seipp <austin@well-typed.com>
6 years agoFix formatting (fixes #8551)
Arash Rouhani [Wed, 20 Nov 2013 01:40:26 +0000 (02:40 +0100)] 
Fix formatting (fixes #8551)

Signed-off-by: Arash Rouhani <rarash@student.chalmers.se>
Reviewed-by: Austin Seipp <austin@well-typed.com>
6 years agoM-x delete-trailing-whitespace
Austin Seipp [Tue, 12 Nov 2013 22:46:03 +0000 (16:46 -0600)] 
M-x delete-trailing-whitespace

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoFix make binary-dist on OS X (#8122)
Austin Seipp [Tue, 12 Nov 2013 22:43:50 +0000 (16:43 -0600)] 
Fix make binary-dist on OS X (#8122)

Authored-by: Christiaan Baaj <christiaan.baaij@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>