- 08 Sep, 2009 1 commit
-
-
Simon Marlow authored
-
- 26 Aug, 2009 1 commit
-
-
Isaac Dupree authored
-
- 24 Jul, 2009 1 commit
-
-
Ian Lynagh authored
-
- 01 Jul, 2009 1 commit
-
-
batterseapower authored
-
- 28 May, 2009 1 commit
-
-
simonpj@microsoft.com authored
When you say -ddump-splices, the "before" expression is now *renamed* but not *typechecked" Reason (a) less typechecking crap (b) data constructors after type checking have been changed to their *wrappers*, and that makes them print always fully qualified
-
- 27 May, 2009 1 commit
-
-
simonpj@microsoft.com authored
At last! Trac #1476 and #3177 This patch extends Template Haskell by allowing splices in types. For example f :: Int -> $(burble 3) A type splice should work anywhere a type is expected. This feature has been long requested, and quite a while ago I'd re-engineered the type checker to make it easier, but had never got around to finishing the job. With luck, this does it. There's a ToDo in the HsSpliceTy case of RnTypes.rnHsType, where I am not dealing properly with the used variables; but that's awaiting the refactoring of the way we report unused names.
-
- 26 Mar, 2009 1 commit
-
-
chak@cse.unsw.edu.au. authored
-
- 25 Mar, 2009 1 commit
-
-
chak@cse.unsw.edu.au. authored
- Reifying a type family returns a TH family declaration - Reifying a data constructor from a data instance attributes that constructor to the family (not the representation tycon) - Ideally, we should have facilities to reify all type/data instances of a given family (and the same for instances of a class). I haven't added that here as it involves some API design.
-
- 19 Mar, 2009 1 commit
-
-
chak@cse.unsw.edu.au. authored
-
- 04 Feb, 2009 1 commit
-
-
simonpj@microsoft.com authored
I followed the suggestion in Trac #2994, which took longer than I expected. As usual I did a bit of tidying up at the same time, and improved a few other error reports.
-
- 02 Jan, 2009 1 commit
-
-
simonpj@microsoft.com authored
This biggish patch addresses Trac #2670. The main effect is to make record selectors into ordinary functions, whose unfoldings appear in interface files, in contrast to their previous existence as magic "implicit Ids". This means that the usual machinery of optimisation, analysis, and inlining applies to them, which was failing before when the selector was somewhat complicated. (Which it can be when strictness annotations, unboxing annotations, and GADTs are involved.) The change involves the following points * Changes in Var.lhs to the representation of Var. Now a LocalId can have an IdDetails as well as a GlobalId. In particular, the information that an Id is a record selector is kept in the IdDetails. While compiling the current module, the record selector *must* be a LocalId, so that it participates properly in compilation (free variables etc). This led me to change the (hidden) representation of Var, so that there is now only one constructor for Id, not two. * The IdDetails is persisted into interface files, so that an importing module can see which Ids are records selectors. * In TcTyClDecls, we generate the record-selector bindings in renamed, but not typechecked form. In this way, we can get the typechecker to add all the types and so on, which is jolly helpful especially when GADTs or type families are involved. Just like derived instance declarations. This is the big new chunk of 180 lines of code (much of which is commentary). A call to the same function, mkAuxBinds, is needed in TcInstDcls for associated types. * The typechecker therefore has to pin the correct IdDetails on to the record selector, when it typechecks it. There was a neat way to do this, by adding a new sort of signature to HsBinds.Sig, namely IdSig. This contains an Id (with the correct Name, Type, and IdDetails); the type checker uses it as the binder for the final binding. This worked out rather easily. * Record selectors are no longer "implicit ids", which entails changes to IfaceSyn.ifaceDeclSubBndrs HscTypes.implicitTyThings TidyPgm.getImplicitBinds (These three functions must agree.) * MkId.mkRecordSelectorId is deleted entirely, some 300+ lines (incl comments) of very error prone code. Happy days. * A TyCon no longer contains the list of record selectors: algTcSelIds is gone The renamer is unaffected, including the way that import and export of record selectors is handled. Other small things * IfaceSyn.ifaceDeclSubBndrs had a fragile test for whether a data constructor had a wrapper. I've replaced that with an explicit flag in the interface file. More robust I hope. * I renamed isIdVar to isId, which touched a few otherwise-unrelated files.
-
- 30 Dec, 2008 1 commit
-
-
simonpj@microsoft.com authored
This tidy-up fixes Trac #2901, and eliminates 20 lines of code. Mainly this is done by making a version of lookupGlobalOccRn that returns (Maybe Name); this replaces lookupSrcOccRn but does more.
-
- 31 Oct, 2008 2 commits
-
-
Thomas Schilling authored
-
Thomas Schilling authored
-
- 30 Oct, 2008 1 commit
-
-
simonpj@microsoft.com authored
This patch, written by Max Bolingbroke, does two things 1. It adds a new CoreM monad (defined in simplCore/CoreMonad), which is used as the top-level monad for all the Core-to-Core transformations (starting at SimplCore). It supports * I/O (for debug printing) * Unique supply * Statistics gathering * Access to the HscEnv, RuleBase, Annotations, Module The patch therefore refactors the top "skin" of every Core-to-Core pass, but does not change their functionality. 2. It adds a completely new facility to GHC: Core "annotations". The idea is that you can say {#- ANN foo (Just "Hello") #-} which adds the annotation (Just "Hello") to the top level function foo. These annotations can be looked up in any Core-to-Core pass, and are persisted into interface files. (Hence a Core-to-Core pass can also query the annotations of imported things.) Furthermore, a Core-to-Core pass can add new annotations (eg strictness info) of its own, which can be queried by importing modules. The design of the annotation system is somewhat in flux. It's designed to work with the (upcoming) dynamic plug-ins mechanism, but is meanwhile independently useful. Do not merge to 6.10!
-
- 03 Oct, 2008 3 commits
-
-
Ian Lynagh authored
-
Ian Lynagh authored
Ifdefs for whether we had extensible exceptions or not were spreading through GHC's source, and things would only have got worse for the next 2-3 years, so instead we now use an implementation of extensible exceptions built on top of the old exception type.
-
simonpj@microsoft.com authored
nameModule fails on an InternalName. These ASSERTS tell you which call failed.
-
- 31 Jul, 2008 2 commits
-
-
Ian Lynagh authored
-
Ian Lynagh authored
TopHandler now uses the new extensible exceptions module, so we need to interact with it using the new types.
-
- 30 Jul, 2008 1 commit
-
-
Ian Lynagh authored
-
- 13 Jul, 2008 1 commit
-
-
Ian Lynagh authored
-
- 04 Jun, 2008 1 commit
-
-
simonpj@microsoft.com authored
-
- 06 May, 2008 1 commit
-
-
Ian Lynagh authored
There are some unused things, but I am not sure if the intention is that they will be used in the future. Names implied they were related to splicing in patterns and types.
-
- 12 Apr, 2008 1 commit
-
-
Ian Lynagh authored
-
- 15 Mar, 2008 1 commit
-
-
Ian Lynagh authored
-
- 17 Jan, 2008 2 commits
- 18 Jan, 2008 1 commit
-
-
simonpj@microsoft.com authored
This patch adds quasi-quotation, as described in "Nice to be Quoted: Quasiquoting for Haskell" (Geoffrey Mainland, Haskell Workshop 2007) Implemented by Geoffrey and polished by Simon. Overview ~~~~~~~~ The syntax for quasiquotation is very similar to the existing Template haskell syntax: [$q| stuff |] where 'q' is the "quoter". This syntax differs from the paper, by using a '$' rather than ':', to avoid clashing with parallel array comprehensions. The "quoter" is a value of type Language.Haskell.TH.Quote.QuasiQuoter, which contains two functions for quoting expressions and patterns, respectively. quote = Language.Haskell.TH.Quote.QuasiQuoter quoteExp quotePat quoteExp :: String -> Language.Haskell.TH.ExpQ quotePat :: String -> Language.Haskell.TH.PatQ TEXT is passed unmodified to the quoter. The context of the quasiquotation statement determines which of the two quoters is called: if the quasiquotation occurs in an expression context, quoteExp is called, and if it occurs in a pattern context, quotePat is called. The result of running the quoter on its arguments is spliced into the program using Template Haskell's existing mechanisms for splicing in code. Note that although Template Haskell does not support pattern brackets, with this patch binding occurrences of variables in patterns are supported. Quoters must also obey the same stage restrictions as Template Haskell; in particular, in this example quote may not be defined in the module where it is used as a quasiquoter, but must be imported from another module. Points to notice ~~~~~~~~~~~~~~~~ * The whole thing is enabled with the flag -XQuasiQuotes * There is an accompanying patch to the template-haskell library. This involves one interface change: currentModule :: Q String is replaced by location :: Q Loc where Loc is a data type defined in TH.Syntax thus: data Loc = Loc { loc_filename :: String , loc_package :: String , loc_module :: String , loc_start :: CharPos , loc_end :: CharPos } type CharPos = (Int, Int) -- Line and character position So you get a lot more info from 'location' than from 'currentModule'. The location you get is the location of the splice. This works in Template Haskell too of course, and lets a TH program generate much better error messages. * There's also a new module in the template-haskell package called Language.Haskell.TH.Quote, which contains support code for the quasi-quoting feature. * Quasi-quote splices are run *in the renamer* because they can build *patterns* and hence the renamer needs to see the output of running the splice. This involved a bit of rejigging in the renamer, especially concerning the reporting of duplicate or shadowed names. (In fact I found and removed a few calls to checkDupNames in RnSource that are redundant, becuase top-level duplicate decls are handled in RnNames.)
-
- 06 Nov, 2007 1 commit
-
-
simonpj@microsoft.com authored
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).
-
- 05 Nov, 2007 1 commit
-
-
simonpj@microsoft.com authored
-
- 10 Oct, 2007 2 commits
-
-
simonpj@microsoft.com authored
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.
-
simonpj@microsoft.com authored
Fix Trac #1678; be more careful about catching and reporting exceptions in spliced TH monadic computations 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
-
- 04 Sep, 2007 1 commit
-
-
Ian Lynagh authored
-
- 03 Sep, 2007 1 commit
-
-
Ian Lynagh authored
Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.
-
- 01 Sep, 2007 1 commit
-
-
Ian Lynagh authored
-
- 28 Jun, 2007 1 commit
-
-
simonmar@microsoft.com authored
-
- 10 Apr, 2007 1 commit
-
-
twhitehe@uwo.ca authored
Distinguish between userError (i.e., deliberate failure) and other immediate and embedded exceptions for TH splices for trac #1265
-
- 17 Apr, 2007 1 commit
-
-
Simon Marlow authored
This is the result of Bernie Pope's internship work at MSR Cambridge, with some subsequent improvements by me. The main plan was to (a) Reduce the overhead for breakpoints, so we could enable the feature by default without incurrent a significant penalty (b) Scatter more breakpoint sites throughout the code Currently we can set a breakpoint on almost any subexpression, and the overhead is around 1.5x slower than normal GHCi. I hope to be able to get this down further and/or allow breakpoints to be turned off. This patch also fixes up :print following the recent changes to constructor info tables. (most of the :print tests now pass) We now support single-stepping, which just enables all breakpoints. :step <expr> executes <expr> with single-stepping turned on :step single-steps from the current breakpoint The mechanism is quite different to the previous implementation. We share code with the HPC (haskell program coverage) implementation now. The coverage pass annotates source code with "tick" locations which are tracked by the coverage tool. In GHCi, each "tick" becomes a potential breakpoint location. Previously breakpoints were compiled into code that magically invoked a nested instance of GHCi. Now, a breakpoint causes the current thread to block and control is returned to GHCi. See the wiki page for more details and the current ToDo list: http://hackage.haskell.org/trac/ghc/wiki/NewGhciDebugger
-
- 06 Mar, 2007 1 commit
-
-
simonpj@microsoft.com authored
-