
New patches:

[Fix external core syntax (though not full compilation)
Aaron Tomb <atomb@soe.ucsc.edu>**20061113230132
 
 This patch updates the External Core creator, pretty-printer, and parser to
 agree on a concrete syntax for External Core, including the constructs
 required by the change to System FC. Code to create valid ASTs from External
 Core files will come later, as will bits for renaming, typechecking, and
 desugaring.
 
] {
hunk ./compiler/coreSyn/ExternalCore.lhs 65
+  | Keq Ty Ty
hunk ./compiler/coreSyn/MkExternalCore.lhs 23
+import Coercion
hunk ./compiler/coreSyn/MkExternalCore.lhs 183
-make_kind (PredTy p) | isEqPred p = panic "coercion kinds in external core not implemented!"
+make_kind (PredTy p) | isEqPred p = C.Keq (make_ty t1) (make_ty t2)
+    where (t1, t2) = getEqPredTys p
hunk ./compiler/coreSyn/PprExternalCore.lhs 79
+pkind (Keq t1 t2) = parens (pty t1 <> text ":=:" <> pty t2)
hunk ./compiler/coreSyn/PprExternalCore.lhs 136
-pexp (Cast e co) = (text "%cast" <+> pexp e) $$ paty co
+pexp (Cast e co) = (text "%cast" <+> parens (pexp e)) $$ paty co
hunk ./compiler/parser/LexCore.hs 9
-	       || (c == ':') || (c == '$')
+	       || (c == '$') || (c == '-') || (c == '.')
hunk ./compiler/parser/LexCore.hs 32
+lexer cont (':':'=':':':cs) = cont TKcoloneqcolon cs
hunk ./compiler/parser/LexCore.hs 41
-lexer cont (':':cs)     = lexName cont TKcname (':':cs)
+-- 20061103 but it's easier to parse if we split on the colon, and treat them
+-- as several tokens
+lexer cont (':':cs)     = cont TKcolon cs
hunk ./compiler/parser/LexCore.hs 100
+      ("local",rest) -> cont TKlocal rest
hunk ./compiler/parser/ParserCore.y 14
-import Name( Name, nameOccName, nameModule )
+import Name( Name, nameOccName, nameModule, mkExternalName )
hunk ./compiler/parser/ParserCore.y 16
-import PackageConfig	( mainPackageId )
+import PackageConfig	( mainPackageId, stringToPackageId )
hunk ./compiler/parser/ParserCore.y 27
+import Unique
hunk ./compiler/parser/ParserCore.y 49
+ '%local'	{ TKlocal }
hunk ./compiler/parser/ParserCore.y 57
+ ':'		{ TKcolon }
hunk ./compiler/parser/ParserCore.y 59
+ ':=:'		{ TKcoloneqcolon }
hunk ./compiler/parser/ParserCore.y 80
-         : '%module' modid tdefs vdefgs { HsExtCore $2 $3 $4 }
+	-- : '%module' modid tdefs vdefgs	{ HsExtCore $2 $3 $4 }
+	: '%module' modid tdefs vdefgs	{ HsExtCore $2 [] [] }
hunk ./compiler/parser/ParserCore.y 83
+
+-------------------------------------------------------------
+--     Names: the trickiest bit in here
+
+-- A name of the form A.B.C could be:
+--   module A.B.C
+--   dcon C in module A.B
+--   tcon C in module A.B
hunk ./compiler/parser/ParserCore.y 92
-        : CNAME	                 { mkModule mainPackageId  -- ToDo: wrong
-		  			(mkModuleNameFS (mkFastString $1)) }
+	: NAME ':' mparts		{ undefined }
+
+q_dc_name :: { Name }
+	  : NAME ':' mparts		{ undefined }
+
+q_tc_name :: { Name }
+ 	  : NAME ':' mparts		{ undefined }
+
+q_var_occ :: { Name }
+          : NAME ':' vparts             { undefined }
+
+mparts	:: { [String] }
+	: CNAME				{ [$1] }
+	| CNAME '.' mparts		{ $1:$3 }
+
+vparts  :: { [String] }
+        : var_occ                       { [$1] }
+        | CNAME '.' vparts              { $1:$3 }
hunk ./compiler/parser/ParserCore.y 116
-	| tdef ';' tdefs	{$1:$3}
+	| tdef tdefs	{$1:$2}
hunk ./compiler/parser/ParserCore.y 119
-	: '%data' q_tc_name tv_bndrs '=' '{' cons '}'
+	: '%data' q_tc_name tv_bndrs '=' '{' cons '}' ';'
hunk ./compiler/parser/ParserCore.y 125
-	| '%newtype' q_tc_name tv_bndrs trep 
+	| '%newtype' q_tc_name tv_bndrs trep ';'
hunk ./compiler/parser/ParserCore.y 144
+        | con           { [$1] }
hunk ./compiler/parser/ParserCore.y 176
-	: tv_occ    { IfaceTyVar $1 }
+	: fs_var_occ { IfaceTyVar $1 }
hunk ./compiler/parser/ParserCore.y 181
-	: tv_occ atys    { foldl IfaceAppTy (IfaceTyVar $1) $2 }
+	: fs_var_occ atys { foldl IfaceAppTy (IfaceTyVar $1) $2 }
+        | q_var_occ atys  { undefined }
hunk ./compiler/parser/ParserCore.y 199
-	: '%rec' '{' vdefs1 '}' { IfaceRec $3 }
+	: '%rec' '{' vdefs1 '}' { IfaceRec $3 } -- Can be empty. Do we care?
hunk ./compiler/parser/ParserCore.y 204
-	: vdef		        { [$1] }
+	: vdef  	        { [$1] }
hunk ./compiler/parser/ParserCore.y 208
-	: qd_occ '::' ty '=' exp { (($1, $3), $5) }
+	: fs_var_occ '::' ty '=' exp { (($1, $3), $5) }
+        | '%local' vdef              { $2 }
+
hunk ./compiler/parser/ParserCore.y 215
-  -- has OccNames in binding positions
-
-qd_occ :: { FastString }
-        : var_occ { $1 }
-        | d_occ   { $1 }
+  -- has OccNames in binding positions. Ah, but it has Names now!
hunk ./compiler/parser/ParserCore.y 228
-	: '(' var_occ '::' ty ')'	{ ($2,$4) }
-
-id_bndrs :: { [IfaceIdBndr] }
-	: {-empty -}    	{ [] }
-	| id_bndr id_bndrs	{ $1:$2 }
+	: '(' fs_var_occ '::' ty ')'	{ ($2,$4) }
hunk ./compiler/parser/ParserCore.y 231
-	:  tv_occ                    { ($1, ifaceLiftedTypeKind) }
-	|  '(' tv_occ '::' akind ')' { ($2, $4) }
+	:  fs_var_occ                    { ($1, ifaceLiftedTypeKind) }
+	|  '(' fs_var_occ '::' akind ')' { ($2, $4) }
hunk ./compiler/parser/ParserCore.y 247
+        | ty ':=:' ty      { ifaceEq $1 $3 }
hunk ./compiler/parser/ParserCore.y 253
-	: var_occ	         { IfaceLcl $1 }
-        | modid '.' qd_occ	 { IfaceExt undefined {-ToDo!!! (ExtPkg $1 (mkVarOccFS $3))-} }
+	: fs_var_occ    { IfaceLcl $1 }
+        | q_var_occ    	{ IfaceExt $1 }
+	| q_dc_name	{ IfaceExt $1 }
hunk ./compiler/parser/ParserCore.y 271
-        | '%cast' exp aty { IfaceCast $2 $3 }
+        | '%cast' aexp aty { IfaceCast $2 $3 }
hunk ./compiler/parser/ParserCore.y 287
-	: modid '.' d_pat_occ bndrs '->' exp 
-		{ (IfaceDataAlt undefined {-ToDo!!! $3 -}, map ifaceBndrName $4, $6) } 
+	: q_dc_name bndrs '->' exp 
+		{ (IfaceDataAlt $1, map ifaceBndrName $2, $4) } 
hunk ./compiler/parser/ParserCore.y 292
+	| q_dc_name '->' exp 
+		{ (IfaceDataAlt $1, [], $3) } 
hunk ./compiler/parser/ParserCore.y 305
-tv_occ	:: { FastString }
-	: NAME	{ mkFastString $1 }
+fs_var_occ	:: { FastString }
+		: NAME	{ mkFastString $1 }
hunk ./compiler/parser/ParserCore.y 308
-var_occ	:: { FastString }
-	: NAME	{ mkFastString $1 }
+var_occ	:: { String }
+	: NAME	{ $1 }
hunk ./compiler/parser/ParserCore.y 312
--- Type constructor
-q_tc_name	:: { Name }
-        : modid '.' CNAME	{ undefined {-ToDo!!! ExtPkg $1 (mkOccName tcName $3)-} }
-
hunk ./compiler/parser/ParserCore.y 317
--- Data constructor occurrence in an expression;
--- use the varName because that's the worker Id
-d_occ :: { FastString }
-       : CNAME { mkFastString $1 }
-
hunk ./compiler/parser/ParserCore.y 378
+ifaceEq ifT1 ifT2 = IfacePredTy (IfaceEqPred ifT1 ifT2)
+
hunk ./compiler/parser/ParserCoreUtils.hs 33
+   -- TODO: this should just return the module name, without the package name
hunk ./compiler/parser/ParserCoreUtils.hs 51
+ | TKlocal
hunk ./compiler/parser/ParserCoreUtils.hs 59
+ | TKcolon
hunk ./compiler/parser/ParserCoreUtils.hs 61
+ | TKcoloneqcolon
}

Context:

[Add literal-shift rewrite rules
simonpj@microsoft.com**20061113093501
 
 This is a re-factored version of Sam Bronson's patch
 
 Need to take care with logical shifts.
 
] 
[Fixups to PelRules (esp using intResult, wordResult)
simonpj@microsoft.com**20061113090517
 
 In PrelRules we carefully use 'intResult' to trim off the overflow in
 compile-time calculations, but we were not doing so consistently.  This
 patch fixes that, I think, and adds type signatures
 
] 
[Fix typo "comand" (trac #965)
Ian Lynagh <igloo@earth.li>**20061112170946] 
[Zap stray whitespace in lhs formatting
Samuel Bronson <naesten@gmail.com>**20061110183633] 
[Fix up .lhs delimiters a bit
Samuel Bronson <naesten@gmail.com>**20061104015642] 
[find fop.sh
claus.reinke@talk21.com**20061109164054
 
 the fop bundle contains fop.bat and fop.sh, but not fop;
 let configuration find the latter.
 
] 
[Doc nit in OccName
Samuel Bronson <naesten@gmail.com>**20061108192115] 
[Remove STANDALONE_PACKAGE bits that had escaped the removal
Ian Lynagh <igloo@earth.li>**20061110182050] 
[Make StablePtr and friends visible, this seems to be necessary for 64bit architectures
sven.panne@aedion.de**20061110171626] 
[Make all needed prototypes visible to avoid warnings
sven.panne@aedion.de**20061110162743] 
[Added a comment about se.info.type being used uninitialized
sven.panne@aedion.de**20061110162654] 
[Added a workaround for format specifier mismatch
sven.panne@aedion.de**20061110162616] 
[Use implication constraints to improve type inference
simonpj@microsoft.com**20061110133123] 
[Cosmetics and debug printing only
simonpj@microsoft.com**20061110131513] 
[Cosmetics only
simonpj@microsoft.com**20061110131345] 
[Add HsUtils.unguardedGRHSs, and use it
simonpj@microsoft.com**20061110131250] 
[Comments and cosmetics only
simonpj@microsoft.com**20061110131036] 
[Add new utility function, partitionWith
simonpj@microsoft.com**20061110130836] 
[Trim imports
simonpj@microsoft.com**20061110130814] 
[Patch to demand analyser, to handle polymorphism in zipWithDmds
simonpj@microsoft.com**20061110130726] 
[Do not print HsDoc field when pretty-printing patterns (messes up error message)
simonpj@microsoft.com**20061108094813] 
[use the right $(HC) for stage 3
Simon Marlow <simonmar@microsoft.com>**20061109101753] 
[remove unused STANDALONE_PACKAGE stuff
Simon Marlow <simonmar@microsoft.com>**20061109101729] 
[update flag settings after files were relocated
Simon Marlow <simonmar@microsoft.com>**20061108103806] 
[Comment out deeply suspicious (and unused) function insertStableSymbol
simonpj@microsoft.com**20061107171336
 
 The function insertStableSymbol looks utterly wrong, because it
 coerces a value of type 'a' to an Addr#!  That was in turn making the
 code generator get confused (now improved), but since insertStableSymbol
 isn't used at all, I'm just commenting it out.
 
 Meanwhile, this patch also enhances CoreToStg to report the most egregious
 cases where an unsafe coerce is going to confuse the code generator.
 
] 
[Layout and comments only
simonpj@microsoft.com**20061107171040] 
[Warn only of explicit imports that are unused (test is mod177)
simonpj@microsoft.com**20061106161212
 
 This is really a long-standing bug.  See test mod177.
 
] 
[Various debugging print changes; nothing exciting
simonpj@microsoft.com**20061106160244] 
[Tidy up substitutions
simonpj@microsoft.com**20061106155901
 
 The new simplifer stuff exposed the fact that the invariants on the
 TvSubstEnv and IdSubstEnv were insufficiently explicit.  (Resulted in
 a bug found by Sam Brosnon.)
 
 This patch fixes the bug, and tries to document the invariants pretty
 thoroughly. See 
 	Note [Extending the TvSubst] in Type
 	Note [Extenting the Subst]   in CoreSubst
 
 (Most of the new lines are comments.)
 
] 
[Get External Core (-fext-core) working with readline
Samuel Bronson <naesten@gmail.com>**20061101003649
 Had to add support for dynamic C calls and for foreign labels (Addr#
 constants). Actually I only did the printing side -- parsing is not
 done yet. But at least now you can build the libraries with -fext-core.
 
 I also got the function arrow to print out properly again (it was
 printing fully-qualified and z-coded!)
 
 I also added a field for calling convention name to the External
 data constructor in ExternalCore.Exp (for static C calls).
 
 I'm not exactly sure where to document all of this, so I haven't done
 that, though I did comment the code a bit.
] 
[Remove pre-5.04 code
Ian Lynagh <igloo@earth.li>**20061024011026] 
[Major overhaul of the Simplifier
simonpj@microsoft.com**20061101164329
 
 This big patch completely overhauls the Simplifier.  The simplifier
 had grown old and crufty, and was hard to understand and maintain.
 This new version is still quite complicated, because the simplifier
 does a lot, but it's much easier to understand, for me at least.
 
 It does mean that I have touched almost every line of the simplifier,
 so the diff is a large one.
 
 Big changes are these
 
 * When simplifying an Expr we generate a simplified Expr plus a 
   bunch of "floats", which are bindings that have floated out
   of the Expr.  Before, this float stuff was returned separately,
   but not they are embedded in the SimplEnv, which makes the
   plumbing much easier and more robust.  In particular, the
   SimplEnv already meaintains the "in-scope set", and making
   that travel with the floats helps to ensure that we always 
   use the right in-scope set.
 
   This change has a pervasive effect.
 
 * Rather than simplifying the args of a call before trying rules
   and inlining, we now defer simplifying the args until both
   rules and inlining have failed, so we're going to leave a
   call in the result.  This avoids the risk of repeatedly 
   simplifying an argument, which was handled by funny ad-hoc
   flags before.  
   
   The downside is that we must apply the substitution to the args before
   rule-matching; and if thep rule doesn't match that is wasted work.
   But having any rules at all is the exception not the rule, and the
   substitution is lazy, so we only substitute until a no-match is found.
   The code is much more elegant though.
 
 * A SimplCont is now more zipper-like. It used to have an embedded
   function, but that was a bit hard to think about, and now it's
   nice and consistent. The relevant constructors are StrictArg
   and StrictBind
 
 * Each Rule now has an *arity* (gotten by CoreSyn.ruleArity), which 
   tells how many arguments it matches against.  This entailed adding
   a field ru_nargs to a BuiltinRule.  And that made me look at 
   PrelRules; I did quite a bit of refactoring in the end, so the
   diff in PrelRules looks much biggger than it really is.
 
 * A little refactoring in OccurAnal.  The key change is that in 
   the RHS of	x = y `cast` co
   we regard 'y' as "many", so that it doesn't get inlined into 
   the RHS of x.  This allows x to be inlined elsewhere.  It's 
   very like the existing situation for
 		x = Just y
   where we treat 'y' as "many".
 
] 
[Improve error message from ghc --make when filename and modulename differ
simonpj@microsoft.com**20061102123111] 
[Improve handling of unused imports (test is mod75)
simonpj@microsoft.com**20061102120441] 
[Remove unused lookupDeprec function
simonpj@microsoft.com**20061102120402] 
[Fix handling of non-in-scope exports (fixes test mod7)
simonpj@microsoft.com**20061102120304] 
[Comments and layout only
simonpj@microsoft.com**20061102093954] 
[import Maybes wibble
sof@galois.com**20061101221108] 
[add a few #includes to make it compile
sof@galois.com**20061101220950] 
[Trim imports
simonpj@microsoft.com**20061101173439] 
[Default the kind of unconstrained meta-type variables before tcSimplifyTop
simonpj@microsoft.com**20061101173325
 
 This patch fixes a long standing bug, Trac #179, 
 and a recently reported one, Trac #963.
 
 The problem in both cases was an unconstrained type variable 'a', of kind
 argTypeKind (printed "??") or openTypeKind ("?").  At top level we now default
 the kind of such variables to liftedTypeKind ("*").  This is important because
 then instance declarations can match it. The defaulting function is called
 TcMType.zonkTopTyVar, and is commented.  (Most of the extra lines in the
 patch are comments!)
 
] 
[Comments and layout only
simonpj@microsoft.com**20061101170448] 
[Minor refactoring
simonpj@microsoft.com**20061101143416] 
[Remove unused import
simonpj@microsoft.com**20061101142550] 
[Comments only
simonpj@microsoft.com**20061101142343] 
[Make idInfo fail more informatively on TyVars
simonpj@microsoft.com**20061101142246] 
[Improve error message (push to 6.6 branch)
simonpj@microsoft.com**20061101123727] 
[Fix error reporting for contexts during deriving (Trac 958)
simonpj@microsoft.com**20061101122120
 
 When doing the fixpoint iteration for 'deriving' we have to be careful
 not to end up in a loop, even if we have -fallow-undecidable-instances.
 
 Test is tcfail169
 
] 
[Fix a long-standing but obscure bug in worker-wrapper generation
simonpj@microsoft.com**20061101110442
 
 Worker/wrapper generation sometimes has to add a dummy void (State#) argument
 to retain laziness.  But when generating the strictness signature for the
 worker, I forgot to take account of the extra argument, resulting in a
 bogus strictness signature.
 
 Result, chaos.  Trac 317 shows this up, and this patch fixes it.
 
] 
[Move --help, --version etc to 4.4 (modes) because that is what they really are
simonpj@microsoft.com**20061030135204] 
[remove the *.raw files
Simon Marlow <simonmar@microsoft.com>**20061027152129] 
[improve the diagnostic generated by memInventory() for a memory leak
Simon Marlow <simonmar@microsoft.com>**20061027133611] 
[count mut-list bytes, not words
Simon Marlow <simonmar@microsoft.com>**20061027133445] 
[fix calculation of GC Work for 6.6+
Simon Marlow <simonmar@microsoft.com>**20061027103439] 
[copyright updates and add Commentary links
Simon Marlow <simonmar@microsoft.com>**20061026092536] 
[rename spin lock functions, and use macros for non-THREADED_RTS
Simon Marlow <simonmar@microsoft.com>**20061026091814] 
[Remove PAR/GRAN code from the storage manager
Simon Marlow <simonmar@microsoft.com>**20061025111114
 
] 
[markRootPtrTable: write out type in full instead of using evac_fn typedef
Simon Marlow <simonmar@microsoft.com>**20061026085418
 Fixes stage 2 build with -fvia-C
] 
[an expression with a TickBox round it is not in HNF.
andy@galois.com**20061025203829] 
[Adding arrows to the acceptable code for hpc
andy@galois.com**20061025201514] 
[fixing type error inside Hpc inc; we had a 32 bit '1'.
andy@galois.com**20061025201422] 
[Improving error message in CmmLint
andy@galois.com**20061025201338] 
[Changing Main.tix to <prog_name>.tix in the Hpc RTS
andy@galois.com**20061025201229] 
[Add pointer to coding conventions to HACKING
Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20061025164331] 
[6.4 compatiblity
andy@galois.com**20061025075900] 
[Haskell Program Coverage
andy@galois.com**20061024212907
 
 This large checkin is the new ghc version of Haskell
 Program Coverage, an expression-level coverage tool for Haskell.
 
 Parts:
 
  - Hpc.[ch] - small runtime support for Hpc; reading/writing *.tix files.
  - Coverage.lhs - Annotates the HsSyn with coverage tickboxes.
   - New Note's in Core,
       - TickBox      -- ticked on entry to sub-expression
       - BinaryTickBox  -- ticked on exit to sub-expression, depending
 	       	     -- on the boolean result.
 
   - New Stg level TickBox (no BinaryTickBoxes, though) 
 
 You can run the coverage tool with -fhpc at compile time. 
 Main must be compiled with -fhpc. 
 				      
] 
[fix 5.04 compile
Simon Marlow <simonmar@microsoft.com>**20061024133943] 
[fix indentation wibble to make it compile with 5.04
Simon Marlow <simonmar@microsoft.com>**20061024122800] 
[Re-enable TABLES_NEXT_TO_CODE for powerpc (was accidentally disabled)
wolfgang.thaller@gmx.net**20061023203321] 
[Split GC.c, and move storage manager into sm/ directory
Simon Marlow <simonmar@microsoft.com>**20061024091357
 In preparation for parallel GC, split up the monolithic GC.c file into
 smaller parts.  Also in this patch (and difficult to separate,
 unfortunatley):
   
   - Don't include Stable.h in Rts.h, instead just include it where
     necessary.
   
   - consistently use STATIC_INLINE in source files, and INLINE_HEADER
     in header files.  STATIC_INLINE is now turned off when DEBUG is on,
     to make debugging easier.
   
   - The GC no longer takes the get_roots function as an argument.
     We weren't making use of this generalisation.
 
] 
[fix a printf format warning
Simon Marlow <simonmar@microsoft.com>**20061024091323] 
[add prototypes for exitHashTable()
Simon Marlow <simonmar@microsoft.com>**20061020102934] 
[remove ^Ms
Simon Marlow <simonmar@microsoft.com>**20061019141218] 
[add pure spin locks
Simon Marlow <simonmar@microsoft.com>**20061019135620] 
[comments only: document allocateLocal()
Simon Marlow <simonmar@microsoft.com>**20061019101200] 
[rename allocated_bytes() to allocatedBytes()
Simon Marlow <simonmar@microsoft.com>**20061019101129] 
[remove performGCWithRoots()
Simon Marlow <simonmar@microsoft.com>**20061019101102
 I don't think this can ever be useful, because to add more roots you
 need to do it consistently for every GC.  The right way to add roots
 is to use newStablePtr.
 
] 
[Bump the HEAD to 6.7
Ian Lynagh <igloo@earth.li>**20061024003553] 
[Clean up debugging code in RnNames
Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20061023180503] 
[wibble in parseStaticFlags
Simon Marlow <simonmar@microsoft.com>**20061023145817
 should fix profiling and unreg in HEAD
] 
[Improve error messages for indexed types
Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20061022171212] 
[A little abstraction
basvandijk@home.nl**20061019152328] 
[Fix handling of family instances in the presense of this doc stuff
Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20061022004904
 - Not sure whether I do the right thing, because I don't understand the
   doc stuff.  However, the original code was definitely wrong and
   breaking the renaming of family instance declarations.
 - The important point is that in
 
     data instance T pats = rhs
 
   T is *not* a defining occurence of T (similarly as C is not a defining
   occurence in "instance C Int").
] 
[TAG 2006-10-22
Ian Lynagh <igloo@earth.li>**20061022003640] 
Patch bundle hash:
23b0983f802b1c6428c3eb3b877ca3db4fee05cc
