| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
| |
I have observed that whenever GHC tells me that I have possibly
incorrect indentation, the real problem is often that I forgot
to close some sort of bracket.
|
|\
| |
| |
| |
| | |
Fix conflicts in:
compiler/main/DynFlags.hs
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Summary:
- mdo expressions are enabled by RecursiveDo pragma
- mdo expressions perform full segmentation
- 'rec' groups inside 'do' are changed so they do *not*
perform any segmentation.
- Both 'mdo' and 'rec' are enabled by 'RecursiveDo'
'DoRec' is deprecated in favour of 'RecursiveDo'
(The 'rec' keyword is also enabled by 'Arrows', as now.)
Thanks to Levent for doing all the work
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were hitting a problem when reading the LANGUAGE/OPTIONS pragmas
from GHC.TypeLits, where the buffer ended "{-". The rules for the
start-comment lexeme check that "{-" is not followed by "#", but the
test returned False when there was no next character. Therefore we
were lexing this as as an open-curly lexeme (only consuming the "{",
and not reaching the end of the buffer),
which meant the options parser think that it had reached the end of
the options.
Now we correctly lex as "{-".
|
| |
|
|
|
|
|
|
|
|
| |
This extension is implied by:
* TypeOperators: so that we can import/export things like (+)
* TypeFamilies: because associated type synonyms use "type T"
to name the associated type in a subordinate list.
|
| |
|
|
|
|
|
|
|
| |
For now, the syntax is
type {-# CTYPE "some C type" #-} Foo = ...
newtype {-# CTYPE "some C type" #-} Foo = ...
data {-# CTYPE "some C type" #-} Foo = ...
|
|
|
|
| |
They weren't being lexed any more, but we still had productions!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements the idea of deferring (most) type errors to
runtime, instead emitting only a warning at compile time. The
basic idea is very simple:
* The on-the-fly unifier in TcUnify never fails; instead if it
gets stuck it emits a constraint.
* The constraint solver tries to solve the constraints (and is
entirely unchanged, hooray).
* The remaining, unsolved constraints (if any) are passed to
TcErrors.reportUnsolved. With -fdefer-type-errors, instead of
emitting an error message, TcErrors emits a warning, AND emits
a binding for the constraint witness, binding it
to (error "the error message"), via the new form of evidence
TcEvidence.EvDelayedError. So, when the program is run,
when (and only when) that witness is needed, the program will
crash with the exact same error message that would have been
given at compile time.
Simple really. But, needless to say, the exercise forced me
into some major refactoring.
* TcErrors is almost entirely rewritten
* EvVarX and WantedEvVar have gone away entirely
* ErrUtils is changed a bit:
* New Severity field in ErrMsg
* Renamed the type Message to MsgDoc (this change
touches a lot of files trivially)
* One minor change is that in the constraint solver we try
NOT to combine insoluble constraints, like Int~Bool, else
all such type errors get combined together and result in
only one error message!
* I moved some definitions from TcSMonad to TcRnTypes,
where they seem to belong more
|
|
|
|
|
|
|
|
| |
We no longer have many separate, clashing getDynFlags functions
I've given each GhcMonad its own HasDynFlags instance, rather than
using UndecidableInstances to make a GhcMonad m => HasDynFlags m
instance.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In GHC, this provides an easy way to call a C function via a C wrapper.
This is important when the function is really defined by CPP.
Requires the new CApiFFI extension.
Not documented yet, as it's still an experimental feature at this stage.
|
|\ \
| |/ |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
This was pretty straightforward: collect the filenames in the lexer,
and add them in to the tcg_dependent_files list that the typechecker
collects.
Note that we still don't get #included files in the ghc -M output.
Since we don't normally lex the whole file in ghc -M, this same
mechanism can't be used directly.
|
|
|
|
|
|
|
|
|
| |
This big patch implements a kind-polymorphic core for GHC. The current
implementation focuses on making sure that all kind-monomorphic programs still
work in the new core; it is not yet guaranteed that kind-polymorphic programs
(using the new -XPolyKinds flag) will work.
For more information, see http://haskell.org/haskellwiki/GHC/Kinds
|
| |
|
| |
|
|
|
|
| |
They used to be only derived when DEBUG was on
|
| |
|
| |
|
|
|
|
|
|
| |
This allows the extension (which is on by default) to be turned off,
which gets us a small step closer to replacing Haskell98 records with
something better.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact,
this patch adds a new kind Constraint such that:
Show :: * -> Constraint
(?x::Int) :: Constraint
(Int ~ a) :: Constraint
And you can write *any* type with kind Constraint to the left of (=>):
even if that type is a type synonym, type variable, indexed type or so on.
The following (somewhat related) changes are also made:
1. We now box equality evidence. This is required because we want
to give (Int ~ a) the *lifted* kind Constraint
2. For similar reasons, implicit parameters can now only be of
a lifted kind. (?x::Int#) => ty is now ruled out
3. Implicit parameter constraints are now allowed in superclasses
and instance contexts (this just falls out as OK with the new
constraint solver)
Internally the following major changes were made:
1. There is now no PredTy in the Type data type. Instead
GHC checks the kind of a type to figure out if it is a predicate
2. There is now no AClass TyThing: we represent classes as TyThings
just as a ATyCon (classes had TyCons anyway)
3. What used to be (~) is now pretty-printed as (~#). The box
constructor EqBox :: (a ~# b) -> (a ~ b)
4. The type LCoercion is used internally in the constraint solver
and type checker to represent coercions with free variables
of type (a ~ b) rather than (a ~# b)
|
|
|
|
|
|
| |
support because we have our own, and defining alexGetByte instead of
alexGetChar (actually we also define alexGetChar, for backwards
compatibility).
|
|
|
|
| |
There is a long discussion in the ticket.
|
|
|
|
|
|
|
| |
The -w flag wasn't turning off a few warnings (Opt_WarnMissingImportList,
Opt_WarnMissingLocalSigs, Opt_WarnIdentities). Rather than just adding
them, I've separated the Opt_Warn* contructors off into their own type,
so -w now just sets the list of warning flags to [].
|
| |
|
| |
|
| |
|
|
|
|
| |
They've been deprecated since GHC 6.12.
|
| |
|
| |
|
|
|
|
| |
toplevel variable 'f'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The "Unhelpful" cases are now in a separate type. This allows us to
improve various things, e.g.:
* Most of the panic's in SrcLoc are now gone
* The Lexer now works with RealSrcSpans rather than SrcSpans, i.e. it
knows that it has real locations and thus can assume that the line
number etc really exists
* Some of the more suspicious cases are no longer necessary, e.g.
we no longer need this case in advanceSrcLoc:
advanceSrcLoc loc _ = loc -- Better than nothing
More improvements can probably be made, e.g. tick locations can
probably use RealSrcSpans too.
|
|\ |
|
| | |
|
| | |
|
|\ \
| |/
| |
| |
| | |
Fixed conflicts:
compiler/prelude/PrelNames.lhs
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
compiler/main/HscMain.lhs
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the work of Nils Schweinsberg <mail@n-sch.de>
It adds the language extension -XMonadComprehensions, which
generalises list comprehension syntax [ e | x <- xs] to work over
arbitrary monads.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Also get rid of the old {| |} brackets in the lexer.
Fewer keywords!
|
|\ \ \
| | |/
| |/| |
|
| |/ |
|