New patches: [FIX 1463 (implement 'ghc-pkg find-module') claus.reinke@talk21.com**20071109162652 - the ticket asks for a module2package lookup in ghc-pkg (this would be useful to have in cabal, as well) - we can now ask which packages expose a module we need, eg, when preparing a cabal file or when getting errors after package reorganisations: $ ./ghc-pkg-inplace find-module Var c:/fptools/ghc/driver/package.conf.inplace: (ghc-6.9.20071106) $ ./ghc-pkg-inplace find-module Data.Sequence c:/fptools/ghc/driver/package.conf.inplace: containers-0.1 - implemented as a minor variation on listPackages (as usual, it would be useful if one could combine multiple queries into one) ] { hunk ./utils/ghc-pkg/Main.hs 223 - listPackages cli Nothing + listPackages cli Nothing Nothing hunk ./utils/ghc-pkg/Main.hs 226 - listPackages cli (Just pkgid) + listPackages cli (Just pkgid) Nothing + ["find-module", moduleName] -> do + listPackages cli Nothing (Just moduleName) hunk ./utils/ghc-pkg/Main.hs 462 -listPackages :: [Flag] -> Maybe PackageIdentifier -> IO () -listPackages flags mPackageName = do +listPackages :: [Flag] -> Maybe PackageIdentifier -> Maybe String -> IO () +listPackages flags mPackageName mModuleName = do hunk ./utils/ghc-pkg/Main.hs 470 + | Just this <- mModuleName = -- packages which expose mModuleName + map (\(conf,pkgs) -> (conf, filter (this `exposedInPkg`) pkgs)) + db_stack hunk ./utils/ghc-pkg/Main.hs 550 +exposedInPkg :: String -> InstalledPackageInfo -> Bool +moduleName `exposedInPkg` pkg = moduleName `elem` exposedModules pkg + hunk ./utils/ghc-pkg/Main.hs 958 - [ OF_List ] -> listPackages new_flags Nothing - [ OF_ListLocal ] -> listPackages new_flags Nothing + [ OF_List ] -> listPackages new_flags Nothing Nothing + [ OF_ListLocal ] -> listPackages new_flags Nothing Nothing } Context: [FIX #1617: reloading didn't change the :browse output as it should Simon Marlow **20071107161454 The problem was that because the interface hadn't changed, we were re-using the old ModIface. Unfortunately the ModIface contains the GlobalRdrEnv for the module, and that *had* changed. The fix is to put the new GlobalRdrEnv in the ModIface even if the interface has not otherwise changed. ModIface is not really the right place for the GlobalRdrEnv, but neither is ModDetails, so we should think about a better way to do this. ] [FIX BUILD Simon Marlow **20071107161612 Sorry, should have pushed with previous batch of changes. ] [FIX #1556: GHC's :reload keeps the context, if possible Simon Marlow **20071107124118] [FIX #1561: don't use tabs in pretty-printed output at all. Simon Marlow **20071107113201 Tabs aren't guaranteed to be 8 spaces on every output device, so we shouldn't be using them. Instead I added a little optimisation to use chunks of 8 spaces for long indentations. ] [FIX #1765, #1766 Simon Marlow **20071107111757 - :def! now overwrites a previous command with the same name - :def on its own lists the defined macros - ":undef f g" undefines both f and g ] [#1617: Add :browse! and various other additions to GHCi Simon Marlow **20071107102648 - :browse! a variant of :browse that lists children separately, not in context, and gives import qualifiers in comments SimonM: I also added sorting by source location for interpreted modules in :browse, and alphabetic sorting by name otherwise. For :browse *M, the locally-defined names come before the external ones. - :{ ..lines.. :} (multiline commands) allow existing commands to be spread over multiple lines to improve readability, both interactively and in .ghci (includes a refactoring that unifies the previous three command loops into one, runCommands, fed from cmdqueue, file, or readline) - :set now shows GHCi-specific flag settings (printing/ debugger), as well as non-language dynamic flag settings :show languages show active language flags :show packages show active package flags as well as implicitly loaded packages ] [FIX #1838: use System.Directory.getHomeDirectory instead of getEnv "HOME" Simon Marlow **20071107100653] [catch up with removal of config.mk in the readline package Simon Marlow **20071107095952] [Fix Trac #1813: generalise over *all* type variables at top level, even phantom ones simonpj@microsoft.com**20071106153151 See Note [Silly type synonym] in TcType for further details. This bug (or at least infelicity) has been in GHC for quite a long time. ] [Fix Trac #1814 (staging interaction in Template Haskell and GHCi), and add comments simonpj@microsoft.com**20071106135548 An Id bound by GHCi from a previous Stmt is Global but Internal, and I'd forgotten that, leading to unnecessary restrictions when using TH and GHCi together. This patch fixes the problem and adds lots of explanatory comments (which is where most of the extra lines come from). ] [Improve error messages simonpj@microsoft.com**20071106105258] [Improve manual entry for binding lexically scoped type variables in pattern signatures simonpj@microsoft.com**20071106105151] [Remove trailing spaces from programlisting lines simonpj@microsoft.com**20071106104921] [Remove unhelpful sentence (see Trac #1832) simonpj@microsoft.com**20071106104315 Merge to 6.8 branch ] [fix stage 1 compilation Simon Marlow **20071106142057] [warning police Simon Marlow **20071106140538] [GHC API: add checkAndLoadModule Simon Marlow **20071106140121 Does what the name suggests: it performs the function of both checkModule and load on that module, avoiding the need to process each module twice when checking a batch of modules. This will make Haddock and ghctags much faster. Along with this is the beginnings of a refactoring of the HscMain interface. HscMain now exports functions for separately running the parser, typechecher, and generating ModIface and ModDetails. Eventually the plan is to complete this interface and use it to replace the existing one. ] [update to use latest changes to the GHC API (works much quicker now) Simon Marlow **20071106135430] [warning police Simon Marlow **20071106104019] [Various improvements Simon Marlow **20071105164054 - take the GHC topdir as a runtime argument - deal with files one at a time (fix space leak) ] [build ghctags-inplace Simon Marlow **20071105163954] [updates to ghctags code Simon Marlow **20071105163927] [eliminate a bit of duplication Simon Marlow **20071105143714] [catch up with changes to checkModule Simon Marlow **20071105142217] [reorder the imports Simon Marlow **20070625134151] [add $(GHCTAGS) Simon Marlow **20070625133450] [follow changes in HsRecFields Simon Marlow **20070625133119] [merged patches relating to GhcTags from #946 Simon Marlow **20070625132158 * accomodate changes in the GHC API * refactoring for more readable source code * if the whole group fails, try one file at a time * desperate attempts to handle the GHC build ] [Rules to create TAGS using ghctags Simon Marlow **20070625132047] [request for documentation of a new argument nr@eecs.harvard.edu**20070625131906] [new README file for utils/ghctags nr@eecs.harvard.edu**20061013202756] [proper HC entry for bootstrapping in Makefile Norman Ramsey **20060920042839] [first cut at missing case for ids defined in pattern Norman Ramsey **20060920042757] [change representation of FoundThing Norman Ramsey **20060917050800 refactored FoundThing to use GHC's native representation of source-code locations and to carry the module name so that the TAGS file can contain a qualified name as well as the unqualified name ] [get names of data constructors Norman Ramsey **20060917015539] [do notation for the Maybe monad Norman Ramsey **20060917003410] [load all files at once and compute tags for all Norman Ramsey **20060917002430] [tell GHC not to generate code (thanks Simon M) Norman Ramsey **20060917002353] [cover more cases; take GHC options on command line Norman Ramsey **20060916232755 Bit of a dog's breakfast here: * generate tags for more cases in the syntax * accept -package ghc and other args on command line * scrub away old code for snaffling thru text ] [initial, very incomplete tags generator Norman Ramsey **20060915235033 The ultimate goal is to replace hasktags with a tags generator based on GHC-as-a-library. This file is a very incomplete first cut. ] [Inline implication constraints simonpj@microsoft.com**20071105220807 This patch fixes Trac #1643, where Lennart found that GHC was generating code with unnecessary dictionaries. The reason was that we were getting an implication constraint floated out of an INLINE (actually an instance decl), and the implication constraint therefore wasn't inlined even though it was used only once (but inside the INLINE). Thus we were getting: ic = \d -> foo = _inline_me_ (...ic...) Then 'foo' gets inlined in lots of places, but 'ic' now looks a bit big. But implication constraints should *always* be inlined; they are just artefacts of the constraint simplifier. This patch solves the problem, by adding a WpInline form to the HsWrap type. ] [Comment warning about transparent newtypes simonpj@microsoft.com**20071105220744] [Wibble to earlier case-merge fix simonpj@microsoft.com**20071105220627 This fix avoids a bogus WARN in SimplEnv.substId ] [Improve pretty-printing of Core slightly (avoid indenting let bodies) simonpj@microsoft.com**20071105220535] [Fix an old but subtle bug in the Simplifier simonpj@microsoft.com**20071105161314 I got a Core Lint failure when compiling System.Win32.Info in the Win32 package. It was very delicate: adding or removing a function definition elsewhere in the module (unrelated to the error) made the error go away. Happily, I found it. In SimplUtils.prepareDefault I was comparing an InId with an OutId. We were getting a spurious hit, and hence doing a bogus CaseMerge. This bug has been lurking ever since I re-factored the way that case expressions were simplified, about 6 months ago! ] [Make CoreLint give a more informative error message simonpj@microsoft.com**20071105161217] [Comments about TH staging simonpj@microsoft.com**20071105145340] [Fix freeHaskellFunctionPtr for Darwin/i386 Aaron Tomb **20071029202636] [MERGED: Set interfacedir (using $topdir, not $httptopdir) Ian Lynagh **20071103180803 Mon Oct 29 10:48:25 PDT 2007 Ian Lynagh ] [Teach ghc-pkg about $httptopdir Ian Lynagh **20071029161130] [MERGED: installPackage needs to treat $httptopdir the same as $topdir Ian Lynagh **20071103180259 Sun Oct 28 06:45:34 PDT 2007 Ian Lynagh ] [MERGED: Define and use $httptopdir for the haddock docs locations Ian Lynagh **20071103180023 Sun Oct 28 05:35:52 PDT 2007 Ian Lynagh ] [We need to copy .buildinfo files into the bindists Ian Lynagh **20071028131752] [(>>>) now comes from GHC.Desugar Simon Marlow **20071102155954] [Refactor error recovery slightly simonpj@microsoft.com**20071102130115 Mostly this patch is refacoring, but it also avoids post-tc zonking if the typechecker found errors. This is good because otherwise with DEBUG you can get the "Inventing strangely-kinded TyCon" warning. ] [Avoid Haddock bug #1821 simonpj@microsoft.com**20071102130043] [Update error message to mention -XPatternSignatures instead of -fglasgow-exts simonpj@microsoft.com**20071101180302] [Rejig the error messages a bit; fixes a minor bug simonpj@microsoft.com**20071101175022 The type checker was only reporting the first message if an equality failed to match. This patch does a bit of refactoring and fixes the bug, which was in the bogus use of eqInstMisMatch in tcSimplify.report_no_instances.b This is really a bug in 6.8 too, so this would be good to merge across to the 6.8 branch. ] [Refactor Haddock options David Waern **20071101131757 This patch renames the DOC_OPTIONS pragma to OPTIONS_HADDOCK. It also adds "-- # ..."-style Haddock option pragmas, for compatibility with code that use them. Another change is that both of these two pragmas behave like OPTIONS_GHC, i.e. they are only allowed at the top of the module, they are ignored everywhere else and they are stored in the dynflags. There is no longer any Haddock options in HsSyn. Please merge this to the 6.8.2 branch when 6.8.1 is out, if appropriate. ] [clean ghci-inplace Simon Marlow **20071031093932] [clean Haddock droppings Simon Marlow **20071031093923] [Fix warning in OSMem for darwin Manuel M T Chakravarty **20071030133003] [FIX BUILD: a glitch in the new rules and inlining stuff simonpj@microsoft.com**20071030113857 Don't re-add the worker info to a binder until completeBind. It's not needed in its own RHS, and it may be replaced, via the substitution following postInlineUnconditionally. (Fixes build of the stage2 compiler which fell over when Coercion.lhs was being compiled.) ] [Fix LiberateCase simonpj@microsoft.com**20071029170620 Merge to STABLE please Liberate case was being far too gung-ho about what to specialise. This bug only showed up when a recursive function 'f' has a nested recursive function 'g', where 'g' calls 'f' (as well as recursively calling 'g'). This exact situation happens in GHC/IO.writeLines. This patch puts things right; see Note [When to specialise]. Result: much less code bloat. ] [Improve error-message output slightly simonpj@microsoft.com**20071029162637] [Improve documentation of orphan instances (thanks to Adrian Hey) simonpj@microsoft.com**20071029162505 Please push to stable branch Simon ] [fix installation of haddock.css and friends Simon Marlow **20071029120732] [In a pattern binding, a type sig in the pattern cannot bind a type variable simonpj@microsoft.com**20071027153330 In a pattern binding with a pattern type signature, such as (Just (x::a)) = e the pattern type signature cannot bind type variables. Hence 'a' must be in scope already for the above example to be legal. This has been the situation for some time, but Dan changed it when adding view patterns. This one-line change restores the old behaviour. ] [Substantial improvement to the interaction of RULES and inlining simonpj@microsoft.com**20071029111056 (Merge to 6.8 branch after testing.) There were a number of delicate interactions between RULEs and inlining in GHC 6.6. I've wanted to fix this for a long time, and some perf problems in the 6.8 release candidate finally forced me over the edge! The issues are documented extensively in OccurAnal, Note [Loop breaking and RULES], and I won't duplicate them here. (Many of the extra lines in OccurAnal are comments!) This patch resolves Trac bugs #1709, #1794, #1763, I believe. ] [Add newline in debug print simonpj@microsoft.com**20071026150224] [Explicit pattern match in default case of addTickLHsBind simonpj@microsoft.com**20071024134828] [Generalise the types of mk_FunBind, mk_easy_FunBind, mkVarBind simonpj@microsoft.com**20071024134750] [Fix the build with GHC < 6.4 (foldl1' didn't exist) Ian Lynagh *-20071027210526] [Fix the build with GHC < 6.4 (foldl1' didn't exist) Ian Lynagh **20071027210526] [MERGED: We need to install-docs when making the Windows bindist Ian Lynagh **20071027203220] [We need to set _way=* in rts/ both when making and installing bindists Ian Lynagh **20071027142914 This is a hack, but it means we get libHSrts*.a etc rather than just libHSrts.a. ] [Fix a whole heap of speling errrs in the docs Josef Svenningsson **20071007213858] [Only build/install the man page if XSLTPROC is defined Ian Lynagh **20071027122155] [install the Cabal docs, and make them show up in a binary distribution Simon Marlow **20071026122456] [cp => $(CP) Simon Marlow **20071026111054] [get rid of the html subdirectory under share/doc/ghc/users_guide Simon Marlow **20071026110919] [Make 'improvement' work properly in TcSimplify simonpj@microsoft.com**20071027155459 (Please merge this, and the preceding handful from me to the 6.8 branch.) This patch fixes a serious problem in the type checker, whereby TcSimplify was going into a loop because it thought improvement had taken place, but actually the unificataion was actually deferred. We thereby fix Trac #1781, #1783, #1795, and #1797! In fixing this I found what a mess TcSimplify.reduceContext is! We need to fix this. The main idea is to replace the "improvement flag" in Avails with a simpler and more direct test: have any of the mutable type variables in the (zonked) 'given' or 'irred' constraints been filled in? This test uses the new function TcMType.isFilledMetaTyVar; the test itself is towards the end of reduceContext. I fixed a variety of other infelicities too, and left some ToDos. ] [An implication constraint can abstract over EqInsts simonpj@microsoft.com**20071027155433] [In an AbsBinds, the 'dicts' can include EqInsts simonpj@microsoft.com**20071027154903 An AbsBinds abstrats over evidence, and the evidence can be both Dicts (class constraints, implicit parameters) and EqInsts (equality constraints). So we need to - use varType rather than idType - use instToVar rather than instToId - use zonkDictBndr rather than zonkIdBndr in zonking It actually all worked before, but gave warnings. ] [More notes simonpj@microsoft.com**20071027154702] [Comments only simonpj@microsoft.com**20071027154642] [Add anyM to IOEnv simonpj@microsoft.com**20071027154551] [Add a note to NOTES simonpj@microsoft.com**20071027100220] [Make compileToCore return the module name and type environment along with bindings Tim Chevalier **20071027100530 compileToCore returned just a list of CoreBind, which isn't enough, since to do anything with the resulting Core code, you probably also want the type declarations. I left compileToCore as it is, but added a function compileToCoreModule that returns a complete Core module (with module name, type environment, and bindings). I'm not sure that returning the type environment is the best way to represent the type declarations for the given module, but I don't want to reinvent the External Core wheel for this. ] [binary-dist: Makefile-vars needs HADDOCK_DOCS=YES Simon Marlow **20071025135816] [fix the links in the library documentation index Simon Marlow **20071025152245] [default to installing runhaskell and hsc2hs again, but provide knobs to turn them off Simon Marlow **20071025084222] [Adding hpc documentation about sum and map, push to STABLE. andy@unsafeperformio.com**20071025050341] [Fixing typo in runtime documentation for hpc, push to stable andy@unsafeperformio.com**20071025045456] [Correct a comment Ian Lynagh **20071024114549] [Fix ghc package in bindists; it wasn't adding the depenedency on readline Ian Lynagh **20071024120633] [Fix installing the ghc package .hi files in a bindist Ian Lynagh **20071024114219] [Build the manpage when building, not when installing Ian Lynagh **20071024112914] [Hack to make sure we get all the RTS ways in bindists Ian Lynagh **20071024004155] [Fix installing the documentation in the bindists Ian Lynagh **20071023234624] [-ftype-families -> -XTypeFamilies Ian Lynagh **20071024142828] [FIX #1791: fail with out-of-heap when allocating more than the max heap size in one go Simon Marlow **20071024095420 Normally the out-of-heap check is performed post-GC, but there are cases where we can detect earlier that we definitely have exhausted the heap size limit. ] [Fix more warnings Simon Marlow **20071023131351] [FIX BUILD (on 32-bit platforms): hs_hpc_module() type mismatch Simon Marlow **20071023082233] [patch from #1782; fixes check-packages target on Solaris Simon Marlow **20071022133337] [add PIC relocations for x86_64, and use a simpler hack in place of x86_64_high_symbol() Simon Marlow **20071018125220 This is Wolfgang Thaller's patch sent to cvs-ghc recently, with extra commentary by me. It turns out that this patch is not just a cleanup, it is also necessary for GHCi to work on x86_64 with shared libraries, because previously lookupSymbol() was creating jump-table entries for all symbols looked up that resolved outside 2Gb, whereas Wolfgang's version only generates jump-table entries for 32-bit symbol references in object code that we load. ] [fix creation of ghc-inplace for non-std ways Simon Marlow **20071017152820] [remove an incorrect assertion Simon Marlow **20071016151829] [second attempt to fix C compiler warnings with -fhpc Simon Marlow **20071019133243 The hs_hpc_module() prototype in RtsExternal.h didn't match its usage: we were passing StgWord-sized parameters but the prototype used C ints. I think it accidentally worked because we only ever passed constants that got promoted. The constants unfortunately were sometimes negative, which caused the C compiler to emit warnings. I suspect PprC.pprHexVal may be wrong to emit negative constants in the generated C, but I'm not completely sure. Anyway, it's easy to fix this in CgHpc, which is what I've done. ] [Zonk quantified tyvars with skolems Manuel M T Chakravarty **20071019115653 We used to zonk quantified type variables to regular TyVars. However, this leads to problems. Consider this program from the regression test suite: eval :: Int -> String -> String -> String eval 0 root actual = evalRHS 0 root actual evalRHS :: Int -> a evalRHS 0 root actual = eval 0 root actual It leads to the deferral of an equality (String -> String -> String) ~ a which is propagated up to the toplevel (see TcSimplify.tcSimplifyInferCheck). In the meantime `a' is zonked and quantified to form `evalRHS's signature. This has the *side effect* of also zonking the `a' in the deferred equality (which at this point is being handed around wrapped in an implication constraint). Finally, the equality (with the zonked `a') will be handed back to the simplifier by TcRnDriver.tcRnSrcDecls calling TcSimplify.tcSimplifyTop. If we zonk `a' with a regular type variable, we will have this regular type variable now floating around in the simplifier, which in many places assumes to only see proper TcTyVars. We can avoid this problem by zonking with a skolem. The skolem is rigid (which we requirefor a quantified variable), but is still a TcTyVar that the simplifier knows how to deal with. ] [Fix typo that prevented zonking of rhs of EqInsts Manuel M T Chakravarty **20071018131040 MERGE TO STABLE ] [implement #1468, :browse on its own uses the currently-loaded module Simon Marlow **20071019115751] [FIX #1784: EM_AMD64 and EM_X86_64 might both be defined to the same value Simon Marlow **20071019110223] [Tell Cabal what it's version number is while bootstrapping it Duncan Coutts **20071018222128 This means that it'll work with all the packages that specify a cabal-version ] [FIX #1450: asynchronous exceptions are now printed by +RTS -xc Simon Marlow **20071018134951] [fix -fbreak-on-exception for unregsterised Simon Marlow **20071018110621] [fix :print when !tablesNextToCode Simon Marlow **20071018105340] [fix breakpoints in unregisterised mode Simon Marlow **20071018101929] [Change some ints to unsigned ints Simon Marlow **20071018095503 Fixes some gratuitous warnings when compiling via C with -fhpc ] [fix warnings when compiling via C Simon Marlow **20071018095417] [rollback "accounting wibble: we were missing an alloc_blocks .. " Simon Marlow **20071018094415 I misread the code, now added a comment to explain why it isn't necessary ] [recordMutable: test for gen>0 before calling recordMutableCap Simon Marlow **20071017125657 For some reason the C-- version of recordMutable wasn't verifying that the object was in an old generation before attempting to add it to the mutable list, and this broke maessen_hashtab. This version of recordMutable is only used in unsafeThaw#. ] [re-instate missing parts of "put the @N suffix on stdcall foreign calls in .cmm code" Simon Marlow **20071017144007 These changes were apparently lost during "massive changes to add a 'zipper' representation of C-" ] [Don't barf on error message with non-tc tyvars Manuel M T Chakravarty **20071018060336 MERGE TO STABLE ] [Fix deferring on tyvars in TcUnify.subFunTys Manuel M T Chakravarty **20071018044352] [TcUnify.subFunTys must take type families into account Manuel M T Chakravarty **20071017114326 * A bug reported by Andrew Appleyard revealed that subFunTys did take neither type families nor equalities into account. In a fairly obscure case there was also a coercion ignored. ] [Refactoring: extract platform-specific code from sm/MBlock.c Simon Marlow **20071017134145 Also common-up some duplicate bits in the platform-specific code ] [fix an error message (barf -> sysErrorBelch) Simon Marlow **20071017121855] [fix warning on Windows Simon Marlow **20071017121645] [Don't clean gmp when validating (speeds up validation on Windows) Simon Marlow **20071017100908] [document float2Int# and double2Int# Simon Marlow **20070925121139] [Update HsExpr.hi-boot-6 for view pattern changes simonpj@microsoft.com**20071017120212] [Fix #1709: do not expose the worker for a loop-breaker simonpj@microsoft.com**20071016131840 The massive 'Uni' program produced a situation in which a function that had a worker/wrapper split was chosen as a loop breaker. If the worker is exposed in the interface file, then an importing module may go into an inlining loop: see comments on TidyPgm.tidyWorker. This patch fixes the inlining bug. The code that gives rise to this bizarre case is still not good (it's a bunch of implication constraints and we are choosing a bad loop breaker) but the first thing is to fix the bug. It's rather hard to produce a test case! Please merge to the 6.8 branch. ] [Fix #1662: do not simplify constraints for vanilla pattern matches simonpj@microsoft.com**20071016124710 See Note [Arrows and patterns] in TcPat. This fixes Trac 1662. Test is arrows/should_compile/arrowpat.hs Please merge ] [Eliminate over-zealous warning in CoreToStg simonpj@microsoft.com**20071016124606] [Show inlined function in the header of 'Inlining done' message simonpj@microsoft.com**20071016124535] [Show program size in the simplifier-bailing-out message simonpj@microsoft.com**20071016124450] [View patterns, record wildcards, and record puns Dan Licata **20071010150254 This patch implements three new features: * view patterns (syntax: expression -> pat in a pattern) * working versions of record wildcards and record puns See the manual for detailed descriptions. Other minor observable changes: * There is a check prohibiting local fixity declarations when the variable being fixed is not defined in the same let * The warn-unused-binds option now reports warnings for do and mdo stmts Implementation notes: * The pattern renamer is now in its own module, RnPat, and the implementation is now in a CPS style so that the correct context is delivered to pattern expressions. * These features required a fairly major upheaval to the renamer. Whereas the old version used to collect up all the bindings from a let (or top-level, or recursive do statement, ...) and put them into scope before renaming anything, the new version does the collection as it renames. This allows us to do the right thing with record wildcard patterns (which need to be expanded to see what names should be collected), and it allows us to implement the desired semantics for view patterns in lets. This change had a bunch of domino effects brought on by fiddling with the top-level renaming. * Prior to this patch, there was a tricky bug in mkRecordSelId in HEAD, which did not maintain the invariant necessary for loadDecl. See note [Tricky iface loop] for details. ] [FIX profiling after my storage manager changes Simon Marlow **20071015103939] [More docu for skolemOccurs Manuel M T Chakravarty **20071015075644] [Slightly improved comments in TcTyClsDecls Manuel M T Chakravarty **20071010142023] [TcTyFuns: remove some duplicate code Manuel M T Chakravarty **20071004142315] [TcTyFuns.eqInstToRewrite Manuel M T Chakravarty **20071003145715] [Add allocateInGen() for allocating in a specific generation, and cleanups Simon Marlow **20071012124413 Now allocate() is a synonym for allocateInGen(). I also made various cleanups: there is now less special-case code for supporting -G1 (two-space collection), and -G1 now works with -threaded. ] [optimise isAlive() Simon Marlow **20071012103810] [accounting wibble: we were missing an alloc_blocks++ in allocateLocal() Simon Marlow **20071012101711] [threadStackOverflow should be using allocateLocal Simon Marlow **20071012100405] [FIX #1759 while respecting the ticks andy@galois.com**20071015033319] [Improving the combine mode for hpc andy@galois.com**20071014171009 we now have Processing Coverage files: sum Sum multiple .tix files in a single .tix file combine Combine two .tix files in a single .tix file map Map a function over a single .tix file Where sum joins many .tix files, combine joins two files (with extra functionality possible), and map just applied a function to single .tix file. These changes were improvements driven by hpc use cases. END OF DESCRIPTION*** Place the long patch description above the ***END OF DESCRIPTION*** marker. The first line of this file will be the patch name. This patch contains the following changes: M ./utils/hpc/Hpc.hs -1 +3 M ./utils/hpc/HpcCombine.hs -33 +84 M ./utils/hpc/HpcFlags.hs -11 +59 ] [Fix DoCon: Another try at getting extractResults right simonpj@microsoft.com**20071012162325 For some reason TcSimplify.extractResults is quite difficult to get right. This is another attempt; finally I think I have it. Strangely enough, it's only Sergey's DoCon program that shows up the bug, which manifested as a failure in the Simplifier lookupRecBndr $dGCDRing{v a1Lz} [lid] But it was due to extractResults producing multiple bindings for the same dictionary. Please merge this to the stable branch (after previous patches to TcSimplify though). ] [mention what SCC stands for Simon Marlow **20071011135736] [Add a proper write barrier for MVars Simon Marlow **20071011135505 Previously MVars were always on the mutable list of the old generation, which meant every MVar was visited during every minor GC. With lots of MVars hanging around, this gets expensive. We addressed this problem for MUT_VARs (aka IORefs) a while ago, the solution is to use a traditional GC write-barrier when the object is modified. This patch does the same thing for MVars. TVars are still done the old way, they could probably benefit from the same treatment too. ] [we need to #include "Stg.h" first, we can't rely on GHC to inject it Simon Marlow **20071010153244 This fixes the unreg build, and in general building the RTS code via-C. I'm not sure at what stage this was broken, but I think it was working accidentally before. ] [Fix Trac #1680; check for unboxed tuples in TcType.marshalableTyCon simonpj@microsoft.com**20071011123426] [Fix Trac #1759: do not let ticks get in the way of spotting trivially-true guards simonpj@microsoft.com**20071010164731 GHC spots that an 'otherwise' guard is true, and uses that knowledge to avoid reporting spurious missing-pattern or overlaps with -Wall. The HPC ticks were disguising the 'otherwise', which led to this failure. Now we check. The key change is defining DsGRHSs.isTrueLHsExpr. Test is ds062 ] [Fix Trac #1755; check for stage errors in TH quoted Names simonpj@microsoft.com**20071010150250 There are a number of situations in which you aren't allowed to use a quoted Name in a TH program, such as \x -> 'x But we weren't checking for that! Now we are. Merge to stable branch. Test is TH_qname. ] [checkWellStaged: reverse comparsion (no change in semantics), plus some comments simonpj@microsoft.com**20071010124013] [Add traceTc in tcSimplifyDefault simonpj@microsoft.com**20071010123933] [Improve pretty-printing of splices in HsSyn simonpj@microsoft.com**20071010123726] [Fix Trac #1678; be more careful about catching and reporting exceptions in spliced TH monadic computations simonpj@microsoft.com**20071010145705 Many of the new lines are comments to explain the slightly-convoluted in which exceptions get propagated out of the Q monad. This fixes Trac 1679; test is TH_runIO (as well as the exising TH_fail). Please merge ] [Comments only simonpj@microsoft.com**20071010145646] [FIX BUILD (when compiling base via C): declare n_capabilities Simon Marlow **20071010103704] [GHCi: use non-updatable thunks for breakpoints Simon Marlow **20071010093241 The extra safe points introduced for breakpoints were previously compiled as normal updatable thunks, but they are guaranteed single-entry, so we can use non-updatable thunks here. This restores the tail-call property where it was lost in some cases (although stack squeezing probably often recovered it), and should improve performance. ] [FIX #1681: withBreakAction had too large a scope in runStmt Simon Marlow **20071010085820] [tiny refactoring Simon Marlow **20071009145002] [small reworking of the loop-breaker-choosing algorithm Simon Marlow **20071009145305 Previously inline candidates were given higher preference as non-loop-breakers than constructor applications, but the reason for this was that making a wrapper into a loop-breaker is to be avoided at all costs. This patch refines the algorithm slightly so that wrappers are explicitly avoided by giving them a much higher score, and other inline candidates are given lower scores than constructor applications. This makes almost zero difference to a complete nofib run, so it amounts to just a tidyup. ] [Fix warnings when build w/o readline Manuel M T Chakravarty **20071010101840] [Update documentation for win32 DLL linking Clemens Fruhwirth **20071010074415] [FIX: tidy up TcSimplify following equality constraints additions simonpj@microsoft.com**20071010093334 The combination of "type refinement" for GADTs and the new equality constraints has made TcSimplify rather complicated. And wrong: it generated bogus code for cholewo-eval. This patch is still far from entirely satisfactory. There are too many places where invariants are unclear, and the code is still a bit of a mess. But I believe it's better, and it passes the regression tests! So I think it's good enough for the 6.8 release. Please merge. The main changes are: - get rid of extractLocalResults (which was always suspicious) - instead, treat the 'refinement' along with 'givens', by adding a field to RedEnv, red_reft which travels with red_givens - I also reworked extractResults a bit, which looked wrong to me This entailed changing the Given constructor in Avail to take an Inst rather than a TcId ] [Improve pretty-printing for HsSyn simonpj@microsoft.com**20071010093058] [Fix Trac #1746: make rule-matching work properly with Cast expressions simonpj@microsoft.com**20070929104406 The Cast case of the rule-matcher was simply wrong. This patch fixes it; see Trac #1746. I also fixed the rule generation in SpecConstr to generate a wild-card for the cast expression, which we don't want to match on. This makes the rule more widely applicable; it wasn't the cause of the bug. ] [Small comment only simonpj@microsoft.com**20070929104309] [export n_capabilities, see #1733 Simon Marlow **20071009142701] [FIX #1743, create a fresh unique for each Id we bind at a breakpoint Simon Marlow **20071009142554] [remove vestiges of way 'u' (see #1008) Simon Marlow **20071009130942] [also call initMutex on every task->lock, see #1391 Simon Marlow **20071009122409] [remove the "-unreg" flag and the unregisterised way, see #1008 Simon Marlow **20071009122338] [warning removal Simon Marlow **20071009105138] [warning removal Simon Marlow **20071003170005] [refactoring only: use the parameterised InstalledPackageInfo Simon Marlow **20071003163536 This required moving PackageId from PackageConfig to Module ] [warning removal Simon Marlow **20071003174016] [warning removal Simon Marlow **20071003173448] [warning removal Simon Marlow **20071003173202] [warning removal Simon Marlow **20071003172715] [remove most warnings Simon Marlow **20071003090804] [mkIfaceExports: sort the children of AvailTC Simon Marlow **20071002114917 This fixes a problem with spurious recompilations: each time a module was recompiled, the order of the children would change, causing extra recompilation. MERGE TO STABLE ] [error message fix (#1758) Simon Marlow **20071008134958] [FIX validate for PPC Mac OS X - RegAllocStats.hs Thorkil Naur **20071005144105] [FIX validate for PPC Mac OS X - RegAllocLinear.hs Thorkil Naur **20071005143607] [FIX validate for PPC Mac OS X - Linker.c Thorkil Naur **20071005144908] [FIX validate for PPC Mac OS X - Evac.h Thorkil Naur **20071005144454] [FIX #1748: -main-is wasn't handling the case of a single hierarchical module Simon Marlow **20071008131305 test case is driver062.5 ] [FIX BUILD FD_SETSIZE signed jochemberndsen@dse.nl**20070927132649 On FreeBSD FD_SETSIZE is unsigned. Cast it to a signed int for portability. ] [FIX BUILD addDLL returns const char* jochemberndsen@dse.nl**20070927132619 addDLL returns const char*, not just a char*. Fix compiler warning ] [FIX BUILD `set -o igncr'-issue on FreeBSD jochemberndsen@dse.nl**20070926203750 `set -o igncr' does not work on non-cygwin-systems. Fail silently if this command does not work, instead of aborting the build. ] [comment-out "use vars" in 3 places (see #1739) Simon Marlow **20071008115740] [Change DOCOPTIONS pragma to DOC_OPTIONS David Waern **20071002143849 MERGE TO STABLE ] [FIX: parsing of doc options David Waern **20071002143713 Lexing of the doc options pragma was changed, but but no change was made to the parser to reflect that. This patch fixes this problem. MERGE TO STABLE ] [FIX: add missing case to OccName.isSymOcc David Waern **20071002143459] [Remove warnings from WwLib Manuel M T Chakravarty **20071002130736] [FIX: mkWWcpr takes open alg types into account Manuel M T Chakravarty **20071002130407 - This fixed the failures of GMapAssoc and GMapTop for optmising ways MERGE TO STABLE ] [FIX #1738: KPush rule of FC must take dataConEqTheta into account Manuel M T Chakravarty **20071001154343 MERGE TO STABLE ] [FIX #1729: Don't try to expand syn families with -XLiberalTypeSynonyms Manuel M T Chakravarty **20070929122624 MERGE TO STABLE ] [Some more traceTcs Manuel M T Chakravarty **20070929121941] [FIX: Make boxy splitters aware of type families Manuel M T Chakravarty **20070928225541 MERGE TO STABLE ] [Finally, I managed to squash an infamous bug in :print Pepe Iborra **20070927151300 It turns out the newtype handling code in :print was slipping non mutable Tyvars in the types reconstructed. The error message eventually produced was rather obscure: [src/Tp.hs:75:28-64] *MainTp> :p x *** Exception: No match in record selector Var.tcTyVarDetails [src/Tp.hs:75:28-64] *MainTp> Due to non mutable tyvars, unifyType was failing. A well placed assertion in the unifyType code would have made my life much easier. Which reminds me I should install a -ddump-* system in the RTTI subsystem, or future hackers will run away in swearing. MERGE TO STABLE ] [Be a bit more flexible in terminal identification for do_bold Pepe Iborra **20070927141549 In Os X for instance, by default we have TERM=xterm-color MERGE TO STABLE ] [html_installed_root shouldn't contain $$pkgid Ian Lynagh **20070927130427 This actually didn't break anything, as the shell expanded $pkgid to the empty string, but it was still wrong. ] [Comments and debug output only simonpj@microsoft.com**20070927110842] [further stub filename fix: I managed to break non-stubdir -fvia-C compilation Simon Marlow **20070927102539] [also acquire/release task->lock across fork() Simon Marlow **20070927091331 further attempt to fix #1391 on MacOS ] [FIX -stubdir bug: the .hc file was #including the wrong _stub.h filename Simon Marlow **20070926134539 Using -stubdir together with hierarchical modules, -fvia-C, and --make is essentially broken in 6.6.x. Recently discovered by Cabal's use of -stubdir. Test cases: driver027/driver028 (I've updated them to use -fvia-C, in order to test for this bug). ] [Add STANDARD_OPTS to SRC_HC_OPTS in rts/Makefile so we get -I../includes for .cmm files Ian Lynagh **20070926122637 Patch from Clemens Fruhwirth ] [fix #1734, panic in :show modules after load failure Simon Marlow **20070926100732] [Remove current package from preloaded package set Clemens Fruhwirth **20070926084802] [Fixing #1340, adding HPC Documentation andy@galois.com**20070926055331] [TAG 2007-09-25 Ian Lynagh **20070925164536] Patch bundle hash: 9822c24d7906ecf4f6c6310f34bb84bc322e8bdc