- 21 May, 2003 3 commits
-
-
igloo authored
Rename and reorder the internals for unique ids etc. Also fixed a couple of THSyntax names.
-
igloo authored
The Great Renaming. I hope I've kept everything in sync - and all the tests pass. Now datatypes follow the data Foo = <a kind of Foo>Foo | <another kind of Foo>Foo convention and the smart constructors can be uniformly created by lowercasing the first letter of the constructor.
-
igloo authored
Added support for newtypes to TH and altered a test for them.
-
- 04 May, 2003 1 commit
-
-
igloo authored
Add support for unboxed Ints, Floats and Doubles to Template Haskell.
-
- 22 Apr, 2003 1 commit
-
-
igloo authored
Order declarations in reifications in order of source line number. The bugs still there but it bites less often now... Also remove the type parameterisation and do some type renaming as discussed on the template-haskell list.
-
- 10 Apr, 2003 1 commit
-
-
simonpj authored
Handle Int literals in TH
-
- 16 Mar, 2003 1 commit
-
-
igloo authored
Support for contexts on data types and records from Derek Elkins.
-
- 21 Feb, 2003 1 commit
-
-
simonpj authored
Fix a type-error in desugaring TH code
-
- 20 Feb, 2003 1 commit
-
-
simonpj authored
------------------------------------- Add Core Notes and the {-# CORE #-} pragma ------------------------------------- This is an idea of Hal Daume's. The key point is that Notes in Core are augmented thus: data Note = SCC CostCentre | ... | CoreNote String -- NEW These notes can be injected via a Haskell-source pragma: f x = ({-# CORE "foo" #-} show) ({-# CORE "bar" #-} x) This wraps a (Note (CoreNote "foo")) around the 'show' variable, and a similar note around the argument to 'show'. These notes are basically ignored by GHC, but are emitted into External Core, where they may convey useful information. Exactly how code involving these notes is munged by the simplifier isn't very well defined. We'll see how it pans out. Meanwhile the impact on the rest of the compiler is minimal.
-
- 18 Feb, 2003 1 commit
-
-
igloo authored
Support strictness annotations on data declarations and support the record and infix constructors. Also tweaked the pretty printer a bit.
-
- 12 Feb, 2003 1 commit
-
-
simonpj authored
------------------------------------- Big upheaval to the way that constructors are named ------------------------------------- This commit enshrines the new story for constructor names. We could never really get External Core to work nicely before, but now it does. The story is laid out in detail in the Commentary ghc/docs/comm/the-beast/data-types.html so I will not repeat it here. [Manuel: the commentary isn't being updated, apparently.] However, the net effect is that in Core and in External Core, contructors look like constructors, and the way things are printed is all consistent. It is a fairly pervasive change (which is why it has been so long postponed), but I hope the question is now finally closed. All the libraries compile etc, and I've run many tests, but doubtless there will be some dark corners.
-
- 06 Feb, 2003 1 commit
-
-
simonpj authored
------------------------------------- Fix parsing of floating-point constants in External Core ------------------------------------- This fix accidentally made it into the previous (unrelated) commit, so it's really the *previous* change to LexCore you should look at. The fix updates LexCore so that it can parse literals in scientific notation (e.g. 4.3e-3)
-
- 21 Nov, 2002 1 commit
-
-
simonpj authored
More wibbles to improve declaration splicing
-
- 20 Nov, 2002 3 commits
-
-
chak authored
wibble
-
simonpj authored
Three Template Haskell improvements a) Add type synonyms to THSyntax (and DsMeta, Convert) b) Make Q into a newtype instead of a type synonym c) Eliminate tiresome and error prone argument to DsMeta.wrapGenSyms and similarly addTyVarBinds
-
chak authored
TH: Revised type variable handling in toplevel decls (became necessary due to recent addition of foralls in type representations).
-
- 13 Nov, 2002 1 commit
-
-
chak authored
Added forall's to the representation of type terms
-
- 09 Nov, 2002 1 commit
-
-
chak authored
Changed implementation of representation of negation to use function application instead of a special syntactic form as suggested by SPJ.
-
- 08 Nov, 2002 1 commit
-
-
simonpj authored
------------------ More TH stuff (thanks to Ian L) ------------------ * Make TH Literals have an Integer not an Int * Desguar TH 'foreign import' a bit better * Minor documentation changes
-
- 06 Nov, 2002 1 commit
-
-
simonpj authored
------------------ Template Haskell stuff ------------------ a) Pretty printer for TH (thanks to Ian Lynagh) b) A declaration quote has type Q [Dec], not [Q Dec] as in the paper c) Foreign imports are part of THSyntax, and can be spliced in
-
- 04 Nov, 2002 1 commit
-
-
simonpj authored
Fix reifyDecl
-
- 31 Oct, 2002 1 commit
-
-
simonpj authored
Finish TH exprs with type sigs
-
- 30 Oct, 2002 2 commits
- 29 Oct, 2002 2 commits
-
-
chak authored
Cleaned up `repE'. Reordered to match order of cases in HsExpr and made an effort to catch all cases.
-
chak authored
Added a case for HsPar to repE. Also completed the cases in repE to at least panic for the missing syntactic forms of HsExpr. Is there any good reason for the semi-random order of the cases in repE? Using the same order as in the data declaration for HsExpr would make it easier to spot missing cases.
-
- 25 Oct, 2002 1 commit
-
-
simonpj authored
------------------------ More dependency fiddling ------------------------ WARNING: Interface file format has changed (again) You need to 'make clean' in all library code * Orphan modules are now kept separately Home-package dependencies now contain only home-package dependencies! See HscTypes.Dependencies * Linker now uses the dependencies to do dynamic linking Result: Template Haskell should work even without --make (not yet tested)
-
- 24 Oct, 2002 1 commit
-
-
simonpj authored
------------------------------------------ 1. New try and module and package dependencies 2. OrigNameCache always contains final info ------------------------------------------ These things nearly complete sorting out the incremental linking problem that started us off! 1. This commit separates two kinds of information: (a) HscTypes.Dependencies: What (i) home-package modules, and (ii) other packages this module depends on, transitively. That is, to link the module, it should be enough to link the dependent modules and packages (plus any C stubs etc). Along with this info we record whether the dependent module is (a) a boot interface or (b) an orphan module. So in fact (i) can contain non-home-package modules, namely the orphan ones in other packages (sigh). (b) HscTypes.Usage: What version of imported things were used to actually compile the module. This info is used for recompilation control only. 2. The Finder now returns a correct Module (incl package indicator) first time, so we can install the absolutely final Name in the OrigNameCache when we first come across an occurrence of that name, even if it's only an occurrence in an unfolding in some other interface file. This is much tidier. As a result Module.lhs is much cleaner No DunnoYet No mkVanillaModule ALl very joyful stuff.
-
- 23 Oct, 2002 1 commit
-
-
simonpj authored
------------------------------------------------ Allow implicit-parameter bindings anywhere that a normal binding group is allowed. ------------------------------------------------ That is, you can have implicit parameters * in a let binding * in a where clause (but then you can't have non-implicit ones as well) * in a let group in a list comprehension or monad do-notation The implementation is simple: just add IPBinds to the allowable forms of HsBinds, and remove the HsWith expression form altogether. (It now comes in via the HsLet form.) It'a a nice generalisation really. Needs a bit of documentation, which I'll do next.
-
- 11 Oct, 2002 2 commits
-
-
simonpj authored
More reification wibbling; and -ddump-splices
-
simonpj authored
------------------------------------------ Implement reification for Template Haskell ------------------------------------------ This is entirely un-tested, but I don't think it'll break non-TH stuff. Implements reifyDecl T :: Dec -- Data type T reifyDecl C :: Dec -- Class C reifyType f :: Typ -- Function f I hope.
-
- 09 Oct, 2002 2 commits
-
-
simonpj authored
Fix to mdo, plus SrcLocs on splices and brackets
-
simonpj authored
----------------------------------- Lots more Template Haskell stuff ----------------------------------- At last! Top-level declaration splices work! Syntax is $(f x) not "splice (f x)" as in the paper. Lots jiggling around, particularly with the top-level plumbining. Note the new data type HsDecls.HsGroup.
-
- 27 Sep, 2002 1 commit
-
-
simonpj authored
-------------------------------- Implement recursive do-notation -------------------------------- This commit adds recursive do-notation, which Hugs has had for some time. mdo { x <- foo y ; y <- baz x ; return (y,x) } turns into do { (x,y) <- mfix (\~(x,y) -> do { x <- foo y; y <- baz x }) ; return (y,x) } This is all based on work by Levent Erkok and John Lanuchbury. The really tricky bit is in the renamer (RnExpr.rnMDoStmts) where we break things up into minimal segments. The rest is easy, including the type checker. Levent laid the groundwork, and Simon finished it off. Needless to say, I couldn't resist tidying up other stuff, so there's no guaranteed I have not broken something.
-
- 13 Sep, 2002 2 commits
-
-
simonpj authored
wibbles
-
simonpj authored
-------------------------------------- Make Template Haskell into the HEAD -------------------------------------- This massive commit transfers to the HEAD all the stuff that Simon and Tim have been doing on Template Haskell. The meta-haskell-branch is no more! WARNING: make sure that you * Update your links if you are using link trees. Some modules have been added, some have gone away. * Do 'make clean' in all library trees. The interface file format has changed, and you can get strange panics (sadly) if GHC tries to read old interface files: e.g. ghc-5.05: panic! (the `impossible' happened, GHC version 5.05): Binary.get(TyClDecl): ForeignType * You need to recompile the rts too; Linker.c has changed However the libraries are almost unaltered; just a tiny change in Base, and to the exports in Prelude. NOTE: so far as TH itself is concerned, expression splices work fine, but declaration splices are not complete. --------------- The main change --------------- The main structural change: renaming and typechecking have to be interleaved, because we can't rename stuff after a declaration splice until after we've typechecked the stuff before (and the splice itself). * Combine the renamer and typecheker monads into one (TcRnMonad, TcRnTypes) These two replace TcMonad and RnMonad * Give them a single 'driver' (TcRnDriver). This driver replaces TcModule.lhs and Rename.lhs * The haskell-src library package has a module Language/Haskell/THSyntax which defines the Haskell data type seen by the TH programmer. * New modules: hsSyn/Convert.hs converts THSyntax -> HsSyn deSugar/DsMeta.hs converts HsSyn -> THSyntax * New module typecheck/TcSplice type-checks Template Haskell splices. ------------- Linking stuff ------------- * ByteCodeLink has been split into ByteCodeLink (which links) ByteCodeAsm (which assembles) * New module ghci/ObjLink is the object-code linker. * compMan/CmLink is removed entirely (was out of place) Ditto CmTypes (which was tiny) * Linker.c initialises the linker when it is first used (no need to call initLinker any more). Template Haskell makes it harder to know when and whether to initialise the linker. ------------------------------------- Gathering the LIE in the type checker ------------------------------------- * Instead of explicitly gathering constraints in the LIE tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE) we now dump the constraints into a mutable varabiable carried by the monad, so we get tcExpr :: RenamedExpr -> TcM TypecheckedExpr Much less clutter in the code, and more efficient too. (Originally suggested by Mark Shields.) ----------------- Remove "SysNames" ----------------- Because the renamer and the type checker were entirely separate, we had to carry some rather tiresome implicit binders (or "SysNames") along inside some of the HsDecl data structures. They were both tiresome and fragile. Now that the typechecker and renamer are more intimately coupled, we can eliminate SysNames (well, mostly... default methods still carry something similar). ------------- Clean up HsPat ------------- One big clean up is this: instead of having two HsPat types (InPat and OutPat), they are now combined into one. This is more consistent with the way that HsExpr etc is handled; there are some 'Out' constructors for the type checker output. So: HsPat.InPat --> HsPat.Pat HsPat.OutPat --> HsPat.Pat No 'pat' type parameter in HsExpr, HsBinds, etc Constructor patterns are nicer now: they use HsPat.HsConDetails for the three cases of constructor patterns: prefix, infix, and record-bindings The *same* data type HsConDetails is used in the type declaration of the data type (HsDecls.TyData) Lots of associated clean-up operations here and there. Less code. Everything is wonderful.
-