| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
|
|
|
|
| |
This also means that extsBitmap gets set, whereas is was just being set
to 0 before.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Warning about useless UNPACK pragmas wasn't as easy as I thought.
I did quite a bit of refactoring, which improved the code by refining
the types somewhat. In particular notice that in DataCon, we have
dcStrictMarks :: [HsBang]
dcRepStrictness :: [StrictnessMarks]
The former relates to the *source-code* annotation, the latter to
GHC's representation choice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue here is that
g :: A -> A
f
data A = A
is treated as if you'd written $(f); that is the call of
f is a top-level Template Haskell splice. This patch
makes sure that we *first* check the -XTemplateHaskellFlag
and bleat about a parse error if it's off. Othewise we
get strange seeing "A is out of scope" errors.
|
| |
|
| |
|
| |
|
|
|
|
| |
Now not only is if/then a bracketting pair, but then/else is too
|
|
|
|
| |
If enabled, these accept more layout, but give warnings
|
|
|
|
|
|
|
| |
It used to break on
let {x = 'a'} in x
as the 'in' token would keep closing contexts looking for an implicit
'let' layout.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To print HsTypes correctly we should remember whether the Kind on
a HsTyVarBndr came from type inference, or was put there by the
user. See Note [Printing KindedTyVars] in HsTypes. So instead of
changing a UserTyVar to a KindedTyVar during kind checking, we
simply add a PostTcKind to the UserTyVar.
The change was provoked by Trac #3830, although other changes
mean that #3830 gets a diferent and better error message now.
So this patch is simply doing the Right Thing for the future.
This patch also fixes Trac #3845, which was caused by a *type splice*
not remembering the free *term variables* mentioned in it. Result
was that we build a 'let' when it should have been 'letrec'.
Hence a new FreeVars field in HsSpliceTy.
While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
on HsSpliceTy instead, just like on the UserTyVar.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After some discussion we decided to make a quasi-quote look like
[pads| ...blah... |]
rather than
[$pads| ...blah... |]
as before. The new syntax is quieter, although it does not signal
quite as clearly that there is a splice going on.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a) Added quasi-quote forms for
declarations
types
e.g. f :: [$qq| ... |]
b) Allow Template Haskell pattern quotes (but not splices)
e.g. f x = [p| Int -> $x |]
c) Improve pretty-printing for HsPat to remove superfluous
parens. (This isn't TH related really, but it affects
some of the same code.)
A consequence of (a) is that when gathering and grouping declarations
in RnSource.findSplice, we must expand quasiquotes as we do so.
Otherwise it's all fairly straightforward. I did a little bit of
refactoring in TcSplice.
User-manual changes still to come.
|
| |
|
|
|
|
|
| |
It thought the ) needed to close something, but the $( hadn't
opened anything.
|
| |
|
|
|
|
|
|
| |
So that you can write
f (v1 -> v2 -> pat)
|
|
|
|
|
|
|
|
|
|
| |
See the long Note [INLINE and default methods].
This patch changes a couple of data types, with a knock-on effect on
the format of interface files. A lot of files get touched, but is a
relatively minor change. The main tiresome bit is the extra plumbing
to communicate default methods between the type checker and the
desugarer.
|
|
|
|
|
|
|
|
| |
If we see
foreign export ccall foo :: ...blah...
we now use the "foreign" to suggest -XForeignFunctionInterface
|
| |
|
|
|
|
|
|
|
| |
class C a b
instance Int `C` Bool
This was accidentally disallowed before.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main purpose of this patch is to add a bunch of new rules
to the coercion optimiser. They are documented in the (revised)
Appendix of the System FC paper.
Some code has moved about:
- OptCoercion is now a separate module, mainly because it
now uses tcMatchTy, which is defined in Unify, so OptCoercion
must live higehr up in the hierarchy
- Functions that manipulate Kinds has moved from
Type.lhs to Coercion.lhs. Reason: the function typeKind
now needs to call coercionKind. And in any case, a Kind is
a flavour of Type, so it builds on top of Type; indeed Coercions
and Kinds are both flavours of Type.
This change required fiddling with a number of imports, hence
the one-line changes to otherwise-unrelated modules
- The representation of CoTyCons in TyCon has changed. Instead of
an extensional representation (a kind checker) there is now an
intensional representation (namely TyCon.CoTyConDesc). This was
needed for one of the new coercion optimisations.
|
| |
|
|
|
|
|
|
|
|
|
| |
The problem in #3741 was that we had confused column numbers with byte
offsets, which fails in the case of UTF-8 (amongst other things).
Fortunately we're tracking correct column offsets now, so we didn't
have to make a calculation based on a byte offset. I got rid of two
fields from the PState (last_line_len and last_offs).and one field
from the AI (alex input) constructor.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Also corrected a couple of line 0's to line 1
|
| |
|
| |
|
| |
|
|
|
|
| |
And make the code simpler in the process!
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Caution: Largely untested
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|