- 29 Nov, 2004 1 commit
-
-
simonpj authored
Trim imports
-
- 26 Nov, 2004 1 commit
-
-
simonmar authored
Further integration with the new package story. GHC now supports pretty much everything in the package proposal. - GHC now works in terms of PackageIds (<pkg>-<version>) rather than just package names. You can still specify package names without versions on the command line, as long as the name is unambiguous. - GHC understands hidden/exposed modules in a package, and will refuse to import a hidden module. Also, the hidden/eposed status of packages is taken into account. - I had to remove the old package syntax from ghc-pkg, backwards compatibility isn't really practical. - All the package.conf.in files have been rewritten in the new syntax, and contain a complete list of modules in the package. I've set all the versions to 1.0 for now - please check your package(s) and fix the version number & other info appropriately. - New options: -hide-package P sets the expose flag on package P to False -ignore-package P unregisters P for this compilation For comparison, -package P sets the expose flag on package P to True, and also causes P to be linked in eagerly. -package-name is no longer officially supported. Unofficially, it's a synonym for -ignore-package, which has more or less the same effect as -package-name used to. Note that a package may be hidden and yet still be linked into the program, by virtue of being a dependency of some other package. To completely remove a package from the compiler's internal database, use -ignore-package. The compiler will complain if any two packages in the transitive closure of exposed packages contain the same module. You *must* use -ignore-package P when compiling modules for package P, if package P (or an older version of P) is already registered. The compiler will helpfully complain if you don't. The fptools build system does this. - Note: the Cabal library won't work yet. It still thinks GHC uses the old package config syntax. Internal changes/cleanups: - The ModuleName type has gone away. Modules are now just (a newtype of) FastStrings, and don't contain any package information. All the package-related knowledge is in DynFlags, which is passed down to where it is needed. - DynFlags manipulation has been cleaned up somewhat: there are no global variables holding DynFlags any more, instead the DynFlags are passed around properly. - There are a few less global variables in GHC. Lots more are scheduled for removal. - -i is now a dynamic flag, as are all the package-related flags (but using them in {-# OPTIONS #-} is Officially Not Recommended). - make -j now appears to work under fptools/libraries/. Probably wouldn't take much to get it working for a whole build.
-
- 20 Oct, 2004 1 commit
-
-
simonpj authored
--------------------------------- Fix a bug in usage recording --------------------------------- As a result of the new stuff on hi-boot-file consistency checking, I accidentally caused Foo.hi to record a usage line for module Foo, and this in turn caused rather nasty bad things to happen. In particular, there were occasional crashes of form ghc-6.3: panic! (the `impossible' happened, GHC version 6.3.20041017): forkM Constructor Var.TcTyVar{d r1B9} At least I think that's why the crash happened. Anyway, it was certainly a bug, and this commit fixes it. The main payload of this fix is in Desugar.lhs; the rest is comments and tidying.
-
- 07 Oct, 2004 1 commit
-
-
simonpj authored
Wibbles to hi-boot files and newtypes
-
- 01 Oct, 2004 1 commit
-
-
simonpj authored
------------------------------------ Simplify the treatment of newtypes Complete hi-boot file consistency checking ------------------------------------ In the representation of types, newtypes used to have a special constructor all to themselves, very like TyConApp, called NewTcApp. The trouble is that means we have to *know* when a newtype is a newtype, and in an hi-boot context we may not -- the data type might be declared as data T in the hi-boot file, but as newtype T = ... in the source file. In GHCi, which accumulates stuff from multiple compiles, this makes a difference. So I've nuked NewTcApp. Newtypes are represented using TyConApps again. This turned out to reduce the total amount of code, and simplify the Type data type, which is all to the good. This commit also fixes a few things in the hi-boot consistency checking stuff.
-
- 30 Sep, 2004 1 commit
-
-
simonpj authored
------------------------------------ Add Generalised Algebraic Data Types ------------------------------------ This rather big commit adds support for GADTs. For example, data Term a where Lit :: Int -> Term Int App :: Term (a->b) -> Term a -> Term b If :: Term Bool -> Term a -> Term a ..etc.. eval :: Term a -> a eval (Lit i) = i eval (App a b) = eval a (eval b) eval (If p q r) | eval p = eval q | otherwise = eval r Lots and lots of of related changes throughout the compiler to make this fit nicely. One important change, only loosely related to GADTs, is that skolem constants in the typechecker are genuinely immutable and constant, so we often get better error messages from the type checker. See TcType.TcTyVarDetails. There's a new module types/Unify.lhs, which has purely-functional unification and matching for Type. This is used both in the typechecker (for type refinement of GADTs) and in Core Lint (also for type refinement).
-
- 17 Aug, 2004 1 commit
-
-
simonpj authored
------------------------------- Use merge-sort not quicksort Nuke quicksort altogether ------------------------------- Quicksort has O(n**2) behaviour worst case, and this occasionally bites. In particular, when compiling large files consisting only of static data, we get loads of top-level delarations -- and that led to more than half the total compile time being spent in the strongly connected component analysis for the occurrence analyser. Switching to merge sort completely solved the problem. I've nuked quicksort altogether to make sure this does not happen again.
-
- 16 Aug, 2004 1 commit
-
-
simonpj authored
------------------------------- Add instance information to :i Get rid of the DeclPool ------------------------------- 1. Add instance information to :info command. GHCi now prints out which instances a type or class belongs to, when you use :i 2. Tidy up printing of unqualified names in user output. Previously Outputable.PrintUnqualified was type PrintUnqualified = Name -> Bool but it's now type PrintUnqualified = ModuleName -> OccName -> Bool This turns out to be tidier even for Names, and it's now also usable when printing IfaceSyn stuff in GHCi, eliminating a grevious hack. 3. On the way to doing this, Simon M had the great idea that we could get rid of the DeclPool holding pen, which held declarations read from interface files but not yet type-checked. We do this by eagerly populating the TypeEnv with thunks what, when poked, do the type checking. This is just a logical continuation of lazy import mechanism we've now had for some while. The InstPool and RulePool still exist, but I plan to get rid of them in the same way. The new scheme does mean that more rules get sucked in than before, because previously the TypeEnv was used to mean "this thing was needed" and hence to control which rules were sucked in. But now the TypeEnv is populated more eagerly => more rules get sucked in. However this problem will go away when I get rid of the Inst and Rule pools. I should have kept these changes separate, but I didn't. Change (1) affects mainly TcRnDriver, HscMain, CompMan, InteractiveUI whereas change (3) is more wide ranging.
-
- 02 Jun, 2004 1 commit
-
-
simonpj authored
----------------------------------------------- Record whether data constructors are declared infix ----------------------------------------------- This allows us to generate the InfixC form in Template Hasekll. And for 'deriving' Read and Show, we now read and parse the infix form iff the constructor was declared infix, rather than just if it does not have the default fixity (as before). IfaceSyn changes slightly, so that IfaceConDecl can record their fixity, so there are trivial changes scattered about, and you'll need to recompile everything. In TysWiredIn I took the opportunity to simplify pcDataCon slightly, by eliminating the unused Theta argument.
-
- 25 May, 2004 1 commit
-
-
simonpj authored
----------------------------------------------- Improve location info on unused-import warnings ----------------------------------------------- Improving the location involves plumbing the location of the import a bit more assiduously -- hence change to imp_mods in TcRnTypes
-
- 17 Mar, 2004 1 commit
-
-
simonpj authored
------------------------ More newtype clearing up ------------------------ * Change the representation of TyCons so that it accurately reflects * data (0 or more constrs) * newtype (1 constr) * abstract (unknown) Replaces DataConDetails and AlgTyConFlavour with AlgTyConRhs * Add IfaceSyn.IfaceConDecls, a kind of stripped-down analogue of AlgTyConRhs * Move NewOrData from BasicTypes to HsDecl (it's now an HsSyn thing) * Arrange that Type.newTypeRep and splitRecNewType_maybe unwrap just one layer of new-type-ness, leaving the caller to recurse. This still leaves typeRep and repType in Type.lhs; these functions are still vaguely disturbing and probably should get some attention. Lots of knock-on changes. Fixes bug in ds054.
-
- 25 Feb, 2004 1 commit
-
-
simonpj authored
Yet another fix to the -Onot optimisation that hides data type representations in .hi files. 1. Expose the representation if any fields are exposed 2. Don't expose newtypes whose data-cons are abstract, unless the rep type is a FFI type. (Previously we were more conservative and always exposed newtypes, just in case of a foreign decl.)
-
- 10 Feb, 2004 1 commit
-
-
simonpj authored
Always expose newtypes, at least for now (see comments)
-
- 12 Jan, 2004 1 commit
-
-
simonpj authored
Wibbles to exporting types abstractly
-
- 05 Jan, 2004 1 commit
-
-
simonpj authored
--------------------------------------- Don't expose constructors as vigorously --------------------------------------- GHC used to expose the constructors of a data type in the interface file, even if (a) we were not optimising, and (b) the constructors are not exported. In practice this isn't really necessary, and it's bad because it forces too much recompilation. I've been meaning to fix this for some while. Now the data cons are hidden, even in the interface file, if both (a) and (b) are true. That means less interface file wobbling. Mind you, the interface file still changes, because the to/from functions for generic type classes change their types. But provided you don't use them, you'll get "compilation not required". We could play the same game for classes (by hiding their class ops) but that'd mean we'd have to change the data type for IfaceClassDecl, and I can't be bothered to do that today. It's unusual to have a class which exports none of its methods anyway. On the way, I changed the representation of tcg_exports and mg_exports (from Avails to NameSet), but that should be externally invisible.
-
- 16 Dec, 2003 1 commit
-
-
simonpj authored
Remove unused parameter to groupAvails
-
- 10 Nov, 2003 1 commit
-
-
simonmar authored
Make 'ghc --show-iface' give a reasonable error message on old interface files again. We previously disabled the version check for --show-iface so that you could run --show-iface on a profiled interface file, but this disabled too much error checking. Really we just want to disable the 'way' check, not the whole version check. HEADS UP: interface format changed. Recompile libraries.
-
- 29 Oct, 2003 1 commit
-
-
simonpj authored
Print info about orphan rules and instances
-
- 13 Oct, 2003 1 commit
-
-
simonpj authored
Deal corectly with rules for Ids defined in this module, even when they are imported (as orphans) from other modules. The epicentre for this stuff is SimplCore.
-
- 10 Oct, 2003 1 commit
-
-
simonpj authored
Arrange that loadImportedRules can see the module dependencies of this module, and hence know whether or not to load an hi-boot interface.
-
- 09 Oct, 2003 1 commit
-
-
simonpj authored
Oops; forgot to add this entire directory!
-