| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Modules that need it import it themselves instead.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Fixes Trac #1966.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
MERGE TO STABLE
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|