| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main idea is that when we unify
forall a. t1 ~ forall a. t2
we get constraints from unifying t1~t2 that mention a.
We are producing a coercion witnessing the equivalence of
the for-alls, and inside *that* coercion we need bindings
for the solved constraints arising from t1~t2.
We didn't have way to do this before. The big change is
that here's a new type TcEvidence.TcCoercion, which is
much like Coercion.Coercion except that there's a slot
for TcEvBinds in it.
This has a wave of follow-on changes. Not deep but broad.
* New module TcEvidence, which now contains the HsWrapper
TcEvBinds, EvTerm etc types that used to be in HsBinds
* The typechecker works exclusively in terms of TcCoercion.
* The desugarer converts TcCoercion to Coercion
* The main payload is in TcUnify.unifySigmaTy. This is the
function that had a gross hack before, but is now beautiful.
* LCoercion is gone! Hooray.
Many many fiddly changes in conssequence. But it's nice.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
instance pragmas
* Correct usage of new type wrappers from MkId
* 'VECTORISE [SCALAR] type T = S' didn't work correctly across module boundaries
* Clean up 'VECTORISE SCALAR instance'
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This featurelet allows Trac #5237 to be fixed.
The idea is to allow SPECIALISE pragmas to specify
the phases in which the RULE is active, just as you can
do with RULES themselves.
{-# SPECIALISE [1] foo :: Int -> Int #-}
This feature is so obvious that not having it is really a bug.
There are, needless to say, a few wrinkles. See
Note [Activation pragmas for SPECIALISE]
in DsBinds
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now always check against an expected kind. When we really don't know what
kind to expect, we match against a new meta kind variable.
Also, we are more explicit about tuple sorts:
HsUnboxedTuple -> Produced by the parser
HsBoxedTuple -> Certainly a boxed tuple
HsConstraintTuple -> Certainly a constraint tuple
HsBoxedOrConstraintTuple -> Could be a boxed or a constraint
tuple. Produced by the parser only,
disappears after type checking
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
We only use it for "compiler" sources, i.e. not for libraries.
Many modules have a -fno-warn-tabs kludge for now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
User visible changes
====================
Profilng
--------
Flags renamed (the old ones are still accepted for now):
OLD NEW
--------- ------------
-auto-all -fprof-auto
-auto -fprof-exported
-caf-all -fprof-cafs
New flags:
-fprof-auto Annotates all bindings (not just top-level
ones) with SCCs
-fprof-top Annotates just top-level bindings with SCCs
-fprof-exported Annotates just exported bindings with SCCs
-fprof-no-count-entries Do not maintain entry counts when profiling
(can make profiled code go faster; useful with
heap profiling where entry counts are not used)
Cost-centre stacks have a new semantics, which should in most cases
result in more useful and intuitive profiles. If you find this not to
be the case, please let me know. This is the area where I have been
experimenting most, and the current solution is probably not the
final version, however it does address all the outstanding bugs and
seems to be better than GHC 7.2.
Stack traces
------------
+RTS -xc now gives more information. If the exception originates from
a CAF (as is common, because GHC tends to lift exceptions out to the
top-level), then the RTS walks up the stack and reports the stack in
the enclosing update frame(s).
Result: +RTS -xc is much more useful now - but you still have to
compile for profiling to get it. I've played around a little with
adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem
quite accurately.
I plan to add more facilities for stack tracing (e.g. in GHCi) in the
future.
Coverage (HPC)
--------------
* derived instances are now coloured yellow if they weren't used
* likewise record field names
* entry counts are more accurate (hpc --fun-entry-count)
* tab width is now correct (markup was previously off in source with
tabs)
Internal changes
================
In Core, the Note constructor has been replaced by
Tick (Tickish b) (Expr b)
which is used to represent all the kinds of source annotation we
support: profiling SCCs, HPC ticks, and GHCi breakpoints.
Depending on the properties of the Tickish, different transformations
apply to Tick. See CoreUtils.mkTick for details.
Tickets
=======
This commit closes the following tickets, test cases to follow:
- Close #2552: not a bug, but the behaviour is now more intuitive
(test is T2552)
- Close #680 (test is T680)
- Close #1531 (test is result001)
- Close #949 (test is T949)
- Close #2466: test case has bitrotted (doesn't compile against current
version of vector-space package)
|
|
|
|
| |
* Frontend support (not yet used in the vectoriser)
|
| |
|
| |
|
|
|
|
| |
They used to be only derived when DEBUG was on
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
You can now use type functions in FFI types.
Newtypes are now only looked through if the constructor is in scope.
|
|
|
|
|
|
| |
(in instance and standalone deriving decls)
Fixes Trac #5513.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
representation
This lets IfaceType be dumber, with fewer special cases, because deserialization for more
wired-in names will work. Once we have polymorphic kinds we will be able to replace IfaceTyCon
with a simple IfExtName.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
compiler/iface/BuildTyCl.lhs
compiler/iface/MkIface.lhs
compiler/iface/TcIface.lhs
compiler/typecheck/TcTyClsDecls.lhs
compiler/types/Class.lhs
compiler/utils/Util.lhs
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Basically, now you can write:
class Cls a where
type Typ a
type Typ a = Just a
And now if an instance does not specify an explicit associated type
instance, one will be generated afresh based on that default. So for
example this instance:
instance Cls Int where
Will be equivalent to this one:
instance Cls Int where
type Typ Int = Just Int
|
|/
|
|
| |
This reverts commit 5e102e64d6e581e3ea1f290547fc4be6fce20a00.
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had the idea that you might be able to define
a default instance for an associated type family, thus:
class C a where
type T a :: *
type T a = a -> a
It's an idea that makes sense, but it was only 10% implemented.
This patch just removes that misleading 10%.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch allows
class C a where
type T a b :: *
instance C Int
type T Int b = b -> b
That is, T has a type index 'b' that is not one of the class
variables.
On the way I did a good deal of refactoring (as usual), especially in
TcInstDcls.tcLocalInstDecl1, which checks for consistent instantiation
of the class instance and the type instance. Less code, more
expressiveness. See Note [Checking consistent instantiation]
|
|
|
|
|
|
|
|
|
| |
- Pragma to determine how a given type is vectorised
- At this stage only the VECTORISE SCALAR variant is used by the vectoriser.
- '{-# VECTORISE SCALAR type t #-}' implies that 't' cannot contain parallel arrays and may be used in vectorised code. However, its constructors can only be used in scalar code. We use this, e.g., for 'Int'.
- May be used on imported types
See also http://hackage.haskell.org/trac/ghc/wiki/DataParallel/VectPragma
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of two fields
ic_toplev_scope :: [Module]
ic_imports :: [ImportDecl RdrName]
we now just have one
ic_imports :: [InteractiveImport]
with the auxiliary data type
data InteractiveImport
= IIDecl (ImportDecl RdrName) -- Bring the exports of a particular module
-- (filtered by an import decl) into scope
| IIModule Module -- Bring into scope the entire top-level envt of
-- of this module, including the things imported
-- into it.
This makes lots of code less confusing. No change in behaviour.
It's preparatory to fixing Trac #5147.
While I was at I also
* Cleaned up the handling of the "implicit" Prelude import
by adding a ideclImplicit field to ImportDecl. This
significantly reduces plumbing in the handling of
the implicit Prelude import
* Used record notation consistently for ImportDecl
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|