- 09 Mar, 2005 2 commits
- 23 Feb, 2005 1 commit
-
-
simonpj authored
--------------------------------------------- Make type synonyms uniform with data types so far as infix operators are concerned --------------------------------------------- Merge to STABLE This allows type (a :+: b) c d = ... which was prevented before by accident. I've also documented the fact that classes can be infix; and arranged that class constraints in types can be in infix form. f :: (a :=: b) => ....
-
- 27 Jan, 2005 1 commit
-
-
simonpj authored
-------------------------------------------- Replace hi-boot files with hs-boot files -------------------------------------------- This major commit completely re-organises the way that recursive modules are dealt with. * It should have NO EFFECT if you do not use recursive modules * It is a BREAKING CHANGE if you do ====== Warning: .hi-file format has changed, so if you are ====== updating into an existing HEAD build, you'll ====== need to make clean and re-make The details: [documentation still to be done] * Recursive loops are now broken with Foo.hs-boot (or Foo.lhs-boot), not Foo.hi-boot * An hs-boot files is a proper source file. It is compiled just like a regular Haskell source file: ghc Foo.hs generates Foo.hi, Foo.o ghc Foo.hs-boot generates Foo.hi-boot, Foo.o-boot * hs-boot files are precisely a subset of Haskell. In particular: - they have the same import, export, and scoping rules - errors (such as kind errors) in hs-boot files are checked You do *not* need to mention the "original" name of something in an hs-boot file, any more than you do in any other Haskell module. * The Foo.hi-boot file generated by compiling Foo.hs-boot is a machine- generated interface file, in precisely the same format as Foo.hi * When compiling Foo.hs, its exports are checked for compatibility with Foo.hi-boot (previously generated by compiling Foo.hs-boot) * The dependency analyser (ghc -M) knows about Foo.hs-boot files, and generates appropriate dependencies. For regular source files it generates Foo.o : Foo.hs Foo.o : Baz.hi -- Foo.hs imports Baz Foo.o : Bog.hi-boot -- Foo.hs source-imports Bog For a hs-boot file it generates similar dependencies Bog.o-boot : Bog.hs-boot Bog.o-boot : Nib.hi -- Bog.hs-boto imports Nib * ghc -M is also enhanced to use the compilation manager dependency chasing, so that ghc -M Main will usually do the job. No need to enumerate all the source files. * The -c flag is no longer a "compiler mode". It simply means "omit the link step", and synonymous with -no-link.
-
- 18 Jan, 2005 1 commit
-
-
simonpj authored
------------------------ Reorganisation of hi-boot files ------------------------ The main point of this commit is to arrange that in the Compilation Manager's dependendency graph, hi-boot files are proper nodes. This is important to make sure that we compile everything in the right order. It's a step towards hs-boot files. * The fundamental change is that CompManager.ModSummary has a new field, ms_boot :: IsBootInterface I also tided up CompManager a bit. No change to the Basic Plan. ModSummary is now exported abstractly from CompManager (was concrete) * Hi-boot files now have import declarations. The idea is they are compulsory, so that the dependency analyser can find them * I changed an invariant: the Compilation Manager used to ensure that hscMain was given a HomePackageTable only for the modules 'below' the one being compiled. This was really only important for instances and rules, and it was a bit inconvenient. So I moved the filter to the compiler itself: see HscTypes.hptInstances and hptRules. * Module Packages.hs now defines data PackageIdH = HomePackage -- The "home" package is the package -- curently being compiled | ExtPackage PackageId -- An "external" package is any other package It was just a Maybe type before, so this makes it a bit clearer. * I tried to add a bit better location info to the IfM monad, so that errors in interfaces come with a slightly more helpful error message. See the if_loc field in TcRnTypes --- and follow-on consequences * Changed Either to Maybes.MaybeErr in a couple of places (more perspicuous)
-
- 14 Jan, 2005 1 commit
-
-
simonmar authored
HEADS UP! You now need to use an up to date Happy from CVS to build GHC. Happy version 1.15 will be released shortly. Replace the slow hacked up String-based GetImports with one based on the real Haskell parser. This requires a new addition to Happy to support parsing partial files. We now avoid reading each source file off the disk twice: once to get its module name and imports, and again to parse it. Instead we just slurp it once, and cache the StringBuffer. This should result in improved startup times for ghc --make, especially when there are lots of source files.
-
- 05 Jan, 2005 1 commit
-
-
simonpj authored
Allow trailing semicolon in GADT constructor list
-
- 29 Nov, 2004 1 commit
-
-
simonpj authored
Update ambiguity errors
-
- 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.
-
- 24 Nov, 2004 1 commit
-
-
simonmar authored
Update s/r conflict total after Ross added four more. The total according to the comment is currently one more than the real number, so one of them must have gone away. At some point we should track down which one.
-
- 01 Oct, 2004 1 commit
-
-
simonpj authored
Allow kind signatures in GADT data type declarations
-
- 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).
-
- 07 Sep, 2004 1 commit
-
-
simonmar authored
Fix up the SrcSpan on the rhs of a function binding.
-
- 13 Aug, 2004 1 commit
-
-
simonmar authored
Merge backend-hacking-branch onto HEAD. Yay!
-
- 19 Jul, 2004 1 commit
-
-
simonpj authored
Template Haskell improvements a) Make '() and '[] work. b) Add tupleTypeName, tupleDataName b) Try to improve error message for (lack of) existential data constructors in TH
-
- 23 Jun, 2004 1 commit
-
-
ross authored
arrow notation fixes (problems reported bu John Hughes): * allow an infixexp (exp0) to the left of -<. This adds 4 more shift/reduce conflicts, because it makes if/lambda/let/case/proc before -< ambiguous. This is the same sort of thing as "if x then y else z + 1", and as there shifting does the right thing. * described the grammar more precisely * fixed an example merge to STABLE
-
- 07 May, 2004 1 commit
-
-
simonmar authored
make a SrcSpan for the whole file that is not "unhelpful"
-
- 05 Apr, 2004 2 commits
- 02 Apr, 2004 1 commit
-
-
simonpj authored
Extend the "newtype deriving" feature a little bit more (at the request of Wolfgang Jeltsch) Here's the example: class C a b instance C [a] Char newtype T = T Char deriving( C [a] ) Perfectly sensible, and no reason it should not work. Fixing this required me to generalise the abstract syntax of a 'deriving' item, hence the non-local effects.
-
- 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.
-
- 24 Feb, 2004 1 commit
-
-
simonpj authored
--------------------------------------- Allow constructors to be specified in hi-boot files ---------------------------------------
-
- 23 Jan, 2004 1 commit
-
-
simonmar authored
Small simplification
-
- 16 Dec, 2003 1 commit
-
-
simonpj authored
-------------------- Towards type splices -------------------- Starts the move to supporting type splices, by making HsExpr.HsSplice a separate type of its own, and adding HsSpliceTy constructor to HsType.
-
- 10 Dec, 2003 2 commits
-
-
simonmar authored
Cleanups: - Move the collect* functions from HsSyn into HsUtils. Check that we have a clean separation of utilties over HsSyn, with the generic versions in HsUtils, and the specific versions in RdrHsSyn, RnHsSyn and TcHsSyn as appropriate. - Remove the RdrBinding data type, which was really just a nested list with O(1) append, and use OrdList instead. This makes it much clearer that there's nothing strange going on. - Various other minor cleanups.
-
simonmar authored
Add accurate source location annotations to HsSyn ------------------------------------------------- Every syntactic entity in HsSyn is now annotated with a SrcSpan, which details the exact beginning and end points of that entity in the original source file. All honest compilers should do this, and it was about time GHC did the right thing. The most obvious benefit is that we now have much more accurate error messages; when running GHC inside emacs for example, the cursor will jump to the exact location of an error, not just a line somewhere nearby. We haven't put a huge amount of effort into making sure all the error messages are accurate yet, so there could be some tweaking still needed, although the majority of messages I've seen have been spot-on. Error messages now contain a column number in addition to the line number, eg. read001.hs:25:10: Variable not in scope: `+#' To get the full text span info, use the new option -ferror-spans. eg. read001.hs:25:10-11: Variable not in scope: `+#' I'm not sure whether we should do this by default. Emacs won't understand the new error format, for one thing. In a more elaborate editor setting (eg. Visual Studio), we can arrange to actually highlight the subexpression containing an error. Eventually this information will be used so we can find elements in the abstract syntax corresponding to text locations, for performing high-level editor functions (eg. "tell me the type of this expression I just highlighted"). Performance of the compiler doesn't seem to be adversely affected. Parsing is still quicker than in 6.0.1, for example. Implementation: This was an excrutiatingly painful change to make: both Simon P.J. and myself have been working on it for the last three weeks or so. The basic changes are: - a new datatype SrcSpan, which represents a beginning and end position in a source file. - To reduce the pain as much as possible, we also defined: data Located e = L SrcSpan e - Every datatype in HsSyn has an equivalent Located version. eg. type LHsExpr id = Located (HsExpr id) and pretty much everywhere we used to use HsExpr we now use LHsExpr. Believe me, we thought about this long and hard, and all the other options were worse :-) Additional changes/cleanups we made at the same time: - The abstract syntax for bindings is now less arcane. MonoBinds and HsBinds with their built-in list constructors have gone away, replaced by HsBindGroup and HsBind (see HsSyn/HsBinds.lhs). - The various HsSyn type synonyms have now gone away (eg. RdrNameHsExpr, RenamedHsExpr, and TypecheckedHsExpr are now HsExpr RdrName, HsExpr Name, and HsExpr Id respectively). - Utilities over HsSyn are now collected in a new module HsUtils. More stuff still needs to be moved in here. - MachChar now has a real Char instead of an Int. All GHC versions that can compile GHC now support 32-bit Chars, so this was a simplification.
-