| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The type of the CmmLabel ctor is now
CmmLabel :: PackageId -> FastString -> CmmLabelInfo -> CLabel
- When you construct a CmmLabel you have to explicitly say what
package it is in. Many of these will just use rtsPackageId, but
I've left it this way to remind people not to pretend labels are
in the RTS package when they're not.
- When parsing a Cmm file, labels that are not defined in the
current file are assumed to be in the RTS package.
Labels imported like
import label
are assumed to be in a generic "foreign" package, which is different
from the current one.
Labels imported like
import "package-name" label
are marked as coming from the named package.
This last one is needed for the integer-gmp library as we want to
refer to labels that are not in the same compilation unit, but
are in the same non-rts package.
This should help remove the nasty #ifdef __PIC__ stuff from
integer-gmp/cbits/gmp-wrappers.cmm
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The change is this (see Trac #2798). Instead of writing
mdo { a <- getChar
; b <- f c
; c <- g b
; putChar c
; return b }
you would write
do { a <- getChar
; rec { b <- f c
; c <- g b }
; putChar c
; return b }
That is,
* 'mdo' is eliminated
* 'rec' is added, which groups a bunch of statements
into a single recursive statement
This 'rec' thing is already present for the arrow notation, so it
makes the two more uniform. Moreover, 'rec' lets you say more
precisely where the recursion is (if you want to), whereas 'mdo' just
says "there's recursion here somewhere". Lastly, all this works with
rebindable syntax (which mdo does not).
Currently 'mdo' is enabled by -XRecursiveDo. So we now deprecate this
flag, with another flag -XDoRec to enable the 'rec' keyword.
Implementation notes:
* Some changes in Lexer.x
* All uses of RecStmt now use record syntax
I'm still not really happy with the "rec_ids" and "later_ids" in the
RecStmt constructor, but I don't dare change it without consulting Ross
about the consequences for arrow syntax.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements the Haskell Prime proposal
http://hackage.haskell.org/trac/haskell-prime/wiki/ExplicitForall
Flag is -XExplicitForAll
Implied by Opt_RankNTypes, Opt_Rank2Types, Opt_ScopedTypeVariables,
Opt_LiberalTypeSynonyms, Opt_ExistentialQuantification,
Opt_PolymorphicComponents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements three significant improvements to Template Haskell.
Declaration-level splices with no "$"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This change simply allows you to omit the "$(...)" wrapper for
declaration-level TH splices. An expression all by itself is
not legal, so we now treat it as a TH splice. Thus you can now
say
data T = T1 | T2
deriveMyStuff ''T
where deriveMyStuff :: Name -> Q [Dec]
This makes a much nicer interface for clients of libraries that use
TH: no scary $(deriveMyStuff ''T).
Nested top-level splices
~~~~~~~~~~~~~~~~~~~~~~~~
Previously TH would reject this, saying that splices cannot be nested:
f x = $(g $(h 'x))
But there is no reason for this not to work. First $(h 'x) is run,
yielding code <blah> that is spliced instead of the $(h 'x). Then (g
<blah>) is typechecked and run, yielding code that replaces the
$(g ...) splice.
So this simply lifts the restriction.
Fix Trac #3467: non-top-level type splices
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It appears that when I added the ability to splice types in TH
programs, I failed to pay attention to non-top-level splices -- that
is, splices inside quotatation brackets.
This patch fixes the problem. I had to modify HsType, so there's a
knock-on change to Haddock.
Its seems that a lot of lines of code has changed, but almost all the
new lines are comments!
General tidying up
~~~~~~~~~~~~~~~~~~
As a result of thinking all this out I re-jigged the data type ThStage,
which had far too many values before. And I wrote a nice state transition
diagram to make it all precise;
see Note [Template Haskell state diagram] in TcSplice
Lots more refactoring in TcSplice, resulting in significantly less code.
(A few more lines, but actually less code -- the rest is comments.)
I think the result is significantly cleaner.
|
| |
|
|
|
|
| |
It still lives in darcs, if anyone wants to revive it sometime.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
We already require GHC 6.8 to build, and that included stripPrefix
in Data.List.
|
|
|
|
|
| |
This patch allow you to use "Language CPP", or even "LaNgUaGe CPP",
if you wish, as the manual claims you can.
|
| |
|
|
|
|
|
| |
We only allow simple function label imports, not the normal complicated
business with "wrapper" "dynamic" or data label "&var" imports.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
For now we only get a warning, rather than an error, because the alex
and happy templates don't follow the new rules yet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch sligtly re-adjusts the way in which the syntax of types
is handled:
* In the lexer, '.' and '*' are always accepted in types
(previously it was conditional). This things can't mean
anything else in H98, which is the only reason for doing things
conditionally in the lexer.
* As a result '.' in types is never treated as an operator.
Instead, lacking a 'forall' keyword, it turns into a plain parse error.
* Test for -XKindSignatures in the renamer when processing
a) type variable bindings
b) types with sigs (ty :: kind-sig)
* Make -XKindSignatures be implied by -XTypeFamilies
Previously this was buried in the conditonal lexing of '*'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds an optional CONLIKE modifier to INLINE/NOINLINE pragmas,
{-# NOINLINE CONLIKE [1] f #-}
The effect is to allow applications of 'f' to be expanded in a potential
rule match. Example
{-# RULE "r/f" forall v. r (f v) = f (v+1) #-}
Consider the term
let x = f v in ..x...x...(r x)...
Normally the (r x) would not match the rule, because GHC would be scared
about duplicating the redex (f v). However the CONLIKE modifier says to
treat 'f' like a constructor in this situation, and "look through" the
unfolding for x. So (r x) fires, yielding (f (v+1)).
The main changes are:
- Syntax
- The inlinePragInfo field of an IdInfo has a RuleMatchInfo
component, which records whether or not the Id is CONLIKE.
Of course, this needs to be serialised in interface files too.
- The occurrence analyser (OccAnal) and simplifier (Simplify) treat
CONLIKE thing like constructors, by ANF-ing them
- New function coreUtils.exprIsExpandable is like exprIsCheap, but
additionally spots applications of CONLIKE functions
- A CoreUnfolding has a field that caches exprIsExpandable
- The rule matcher consults this field. See
Note [Expanding variables] in Rules.lhs.
On the way I fixed a lurking variable bug in the way variables are
expanded. See Note [Do not expand locally-bound variables] in
Rule.lhs. I also did a bit of reformatting and refactoring in
Rules.lhs, so the module has more lines changed than are really
different.
|
|
|
|
| |
It's used by ESC/Haskell.
|
|
|
|
|
|
| |
Fix the lexical analyser when it encounters 'x<EOF> and Template
Haskell is on.
|
| |
|
|
|
|
|
|
| |
We require that pragma names are not followed by pragma character,
defined as
isAlphaNum c || c == '_'
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
|
| |
OtherPunctuation, ConnectorPunctuation and DashPunctuation are now
treated as symbols, rather than merely graphic characters.
|
|
|
|
|
|
| |
The patch to switch on lexing of 'forall' inside a RULES pragma
wasn't working. This fixes it so that it does.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds support for raw token streams, that contain more
information than normal token streams (they contains comments at
least). The "lexTokenStream" function brings this support to the
Lexer module. In addition to that, functions have been added to
the GHC module to make easier to recover of the token stream of
a module ("getTokenStream").
Building on that, I added what could be called "rich token
stream": token stream to which have been added the source string
corresponding to each token, the function addSourceToToken takes
a StringBuffer and a starting SrcLoc and a token stream and build
this rich token stream. getRichTokenStream is a convenience
function to get a module rich token stream. "showRichTokenStream"
use the SrcLoc information in such a token stream to get a string
similar to the original source (except unsignificant
whitespaces). Thus "putStrLn . showRichTokenStream =<<
getRichTokenStream s mod" should print a valid module source, the
interesting part being to modify the token stream between the get
and the show of course.
|
|
|
|
|
|
|
|
|
| |
In my travels through the front end I discoverd that -XLiberalTypeSynonyms is
rather thinly described. Furthermore, it alleges that you can write a
forall on the RHS of a type synonym decl, so that means it should enable
the forall keyword.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is an arbitrary choice, but it's strictly more useful than the
current situation, where these characters cannot be used in
identifiers at all.
In Haskell' we may revisit this decision (it's on my list of things to
discuss), but for now this is an improvement for those using caseless
languages.
|
|
|
|
|
|
| |
Compat.Unicode is not utils/Unicode in the compiler.
We build the hpc package with the stage1 compiler.
Nothing else in the compat package was still used.
|
|
|
|
|
| |
Many of the character types were wrong. Now the asc* names really do mean
ASCII, rather than latin-1.
|
|
|
|
|
|
|
| |
* Allow -ffoo flags to be deprecated
* Mark some -ffoo flags as deprecated
* Avoid using deprecated flags in error messages, in the build system, etc
* Add a flag to en/disable the deprecated flag warning
|
|
|
|
| |
so we no longer need to use defaultDynFlags there
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
The -w flag can not be removed, because alex also generates code with lots of warnings.
|
| |
|