summaryrefslogtreecommitdiff
path: root/compiler/hsSyn
Commit message (Collapse)AuthorAgeFilesLines
* Rename WpCo to WpCastsimonpj@microsoft.com2008-04-223-5/+5
|
* Don't import FastString in HsVersions.hIan Lynagh2008-03-294-2/+3
| | | | Modules that need it import it themselves instead.
* Make literals in the syntax tree strictIan Lynagh2008-02-181-3/+3
|
* Fixed warnings in hsSyn/Convert, except for incomplete pattern matchesTwan van Laarhoven2008-02-041-16/+32
|
* Warning clean upManuel M T Chakravarty2008-01-311-1/+1
|
* Add missing (error) case in isIrrefutablePatsimonpj@microsoft.com2008-01-281-2/+6
|
* Add missing (error) case in pprConDeclsimonpj@microsoft.com2008-01-281-0/+5
|
* Fixed warnings in hsSyn/HsSynTwan van Laarhoven2008-01-271-7/+2
|
* Fixed warnings in hsSyn/HsUtilsTwan van Laarhoven2008-01-271-18/+57
|
* Fixed warnings in hsSyn/HsTypesTwan van Laarhoven2008-01-271-32/+37
|
* Fixed warnings in hsSyn/HsDocTwan van Laarhoven2008-01-271-7/+3
|
* Fixed warnings in hsSyn/HsLitTwan van Laarhoven2008-01-271-13/+6
|
* Fixed warnings in hsSyn/HsImpExp, except for incomplete pattern matchesTwan van Laarhoven2008-01-271-9/+10
|
* Fixed warnings in hsSyn/HsPat, except for incomplete pattern matchesTwan van Laarhoven2008-01-271-12/+17
|
* Fixed warnings in hsSyn/HsBinds, except for incomplete pattern matchesTwan van Laarhoven2008-01-271-20/+24
|
* Fixed warnings in hsSyn/HsDecls, except for incomplete pattern matchesTwan van Laarhoven2008-01-271-5/+10
|
* Tidy up the treatment of SPECIALISE pragmassimonpj@microsoft.com2008-01-221-5/+2
| | | | | | | | | | | | Remove the now-redundant "const-dicts" field in SpecPrag In dsBinds, abstract over constant dictionaries in the RULE. This avoids the creation of a redundant, duplicate, rule later in the Specialise pass, which was happening before. There should be no effect on performance either way, just less duplicated code, and the compiler gets a little simpler.
* Add quasi-quotation, courtesy of Geoffrey Mainlandsimonpj@microsoft.com2008-01-186-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* lots of portability changes (#1405)Isaac Dupree2008-01-172-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-recording to avoid new conflicts was too hard, so I just put it all in one big patch :-( (besides, some of the changes depended on each other.) Here are what the component patches were: Fri Dec 28 11:02:55 EST 2007 Isaac Dupree <id@isaac.cedarswampstudios.org> * document BreakArray better Fri Dec 28 11:39:22 EST 2007 Isaac Dupree <id@isaac.cedarswampstudios.org> * properly ifdef BreakArray for GHCI Fri Jan 4 13:50:41 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * change ifs on __GLASGOW_HASKELL__ to account for... (#1405) for it not being defined. I assume it being undefined implies a compiler with relatively modern libraries but without most unportable glasgow extensions. Fri Jan 4 14:21:21 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * MyEither-->EitherString to allow Haskell98 instance Fri Jan 4 16:13:29 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * re-portabilize Pretty, and corresponding changes Fri Jan 4 17:19:55 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * Augment FastTypes to be much more complete Fri Jan 4 20:14:19 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * use FastFunctions, cleanup FastString slightly Fri Jan 4 21:00:22 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * Massive de-"#", mostly Int# --> FastInt (#1405) Fri Jan 4 21:02:49 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * miscellaneous unnecessary-extension-removal Sat Jan 5 19:30:13 EST 2008 Isaac Dupree <id@isaac.cedarswampstudios.org> * add FastFunctions
* Tweak whitespace in HsExprIan Lynagh2008-01-121-449/+481
|
* Fix warnings in HsExprIan Lynagh2008-01-121-23/+27
|
* Make the treatment of equalities more uniformsimonpj@microsoft.com2008-01-072-5/+6
| | | | | | | | | This patch (which is part of the fix for Trac #2018) makes coercion variables be handled more uniformly. Generally, they are treated like dictionaries in the type checker, not like type variables, but in a couple of places we were treating them like type variables. Also when zonking we should use zonkDictBndr not zonkIdBndr.
* Fix Trac #2017simonpj@microsoft.com2008-01-071-1/+1
|
* Implement generalised list comprehensionssimonpj@microsoft.com2007-12-202-2/+39
| | | | | | | | | | | | | | | | | | | | This patch implements generalised list comprehensions, as described in the paper "Comprehensive comprehensions" (Peyton Jones & Wadler, Haskell Workshop 2007). If you don't use the new comprehensions, nothing should change. The syntax is not exactly as in the paper; see the user manual entry for details. You need an accompanying patch to the base library for this stuff to work. The patch is the work of Max Bolingbroke [batterseapower@hotmail.com], with some advice from Simon PJ. The related GHC Wiki page is http://hackage.haskell.org/trac/ghc/wiki/SQLLikeComprehensions
* Improve pretty-printing of InstDeclsimonpj@microsoft.com2007-12-101-4/+4
| | | | | Fixes Trac #1966.
* Print a bit more info in VarBinds (no need to merge)simonpj@microsoft.com2007-11-281-1/+1
|
* FIX Trac 1888; duplicate INLINE pragmassimonpj@microsoft.com2007-11-141-2/+2
| | | | | | | | | | There are actually three things here - INLINE pragmas weren't being pretty-printed properly - They were being classified into too-narrow boxes by eqHsSig - They were being printed in to much detail by hsSigDoc All easy. Test is rnfail048.
* Merge from Haddock: Add <<url>> for imagesDavid Waern2007-11-121-0/+1
| | | | | | | | | | A merge of this patch: Mon Aug 7 16:22:14 CEST 2006 Simon Marlow <simonmar@microsoft.com> * Add <<url>> for images Submitted by: Lennart Augustsson Please merge to the 6.8.2 branch.
* Merge of a patch from the old Haddock branch:David Waern2007-11-121-4/+22
| | | | | | | Fri Jan 5 12:13:41 CET 2007 Simon Marlow <simonmar@microsoft.com> * Fix up a case of extra vertical space after a code block Please merge this to the 6.8.2 branch
* Inline implication constraintssimonpj@microsoft.com2007-11-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 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 -> <stuff> 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.
* Refactor Haddock optionsDavid Waern2007-11-011-3/+2
| | | | | | | | | | | | | | 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.
* Generalise the types of mk_FunBind, mk_easy_FunBind, mkVarBindsimonpj@microsoft.com2007-10-241-6/+6
|
* TcUnify.subFunTys must take type families into accountManuel M T Chakravarty2007-10-171-1/+5
| | | | | | * 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.
* Update HsExpr.hi-boot-6 for view pattern changessimonpj@microsoft.com2007-10-171-2/+5
|
* View patterns, record wildcards, and record punsDan Licata2007-10-107-119/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Improve pretty-printing of splices in HsSynsimonpj@microsoft.com2007-10-101-1/+1
|
* Improve pretty-printing for HsSynsimonpj@microsoft.com2007-10-101-5/+5
|
* FIX: Make boxy splitters aware of type familiesManuel M T Chakravarty2007-09-282-5/+15
| | | | MERGE TO STABLE
* fix error in .hi-boot-6Simon Marlow2007-09-051-1/+1
|
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-0411-11/+11
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-0311-22/+22
| | | | | | | 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.
* FIX for #1080Ross Paterson2007-09-031-0/+16
| | | | | | | Arrow desugaring now uses a private version of collectPatBinders and friends, in order to include dictionary bindings from ConPatOut. It doesn't fix arrowrun004 (#1333), though.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-0111-0/+77
|
* Type checking for type synonym familiesManuel M T Chakravarty2007-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces type checking for type families of which associated type synonyms are a special case. E.g. type family Sum n m type instance Sum Zero n = n type instance Sum (Succ n) m = Succ (Sum n m) where data Zero -- empty type data Succ n -- empty type In addition we support equational constraints of the form: ty1 ~ ty2 (where ty1 and ty2 are arbitrary tau types) in any context where type class constraints are already allowed, e.g. data Equals a b where Equals :: a ~ b => Equals a b The above two syntactical extensions are disabled by default. Enable with the -XTypeFamilies flag. For further documentation about the patch, see: * the master plan http://hackage.haskell.org/trac/ghc/wiki/TypeFunctions * the user-level documentation http://haskell.org/haskellwiki/GHC/Indexed_types The patch is mostly backwards compatible, except for: * Some error messages have been changed slightly. * Type checking of GADTs now requires a bit more type declarations: not only should the type of a GADT case scrutinee be given, but also that of any identifiers used in the branches and the return type. Please report any unexpected behavior and incomprehensible error message for existing code. Contributors (code and/or ideas): Tom Schrijvers Manuel Chakravarty Simon Peyton-Jones Martin Sulzmann with special thanks to Roman Leshchinskiy
* Print infix function definitions correctly in HsSynsimonpj@microsoft.com2007-08-223-17/+32
|
* Updated commentsManuel M T Chakravarty2007-08-191-5/+7
|
* Print fewer parens when pretty-printing HsSynsimonpj@microsoft.com2007-08-091-6/+21
|
* Print more "..." in long lists of declarationssimonpj@microsoft.com2007-08-091-3/+3
|
* Improve pretty-printing of 'foreign' declarationssimonpj@microsoft.com2007-08-041-4/+4
|
* Remove importDavid Waern2007-07-111-1/+0
|