| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The root cause of #8450 is that the new Template Haskell story, with
the renamer doing more of the work of Template Haskell, wasn't dealing
correctly with the keepAlive problem. Consider
g = ..blah...
f = [| g |]
Then f's RHS refers to g's name but not to g, so g was being discarded
as dead code.
Fixing this sucked me into a deep swamp of understanding how all the moving
parts of hte new Template Haskell fit together, leading to a large collection
of related changes and better documentation. Specifically:
* Instead of putting the TH level of a binder in the LocalRdrEnv, there
is now a separate field
tcl_th_bndrs :: NameEnv (TopLevelFlag, ThLevel)
in the TcLclEnv, which records for each binder
a) whether it is syntactically a top-level binder or not
b) its TH level
This deals uniformly with top-level and non-top-level binders, which was
previously dealt with via greviously-delicate meddling with Internal and
External Names. Much better.
* As a result I could remove the tct_level field of ATcId.
* There are consequential changes in TcEnv too, which must also extend the
level bindings. Again, more clarity.
I renamed TcEnv.tcExtendTcTyThingEnv to tcExtendKindEnv2, since it's only used
during kind inference, for (AThing kind) and APromotionErr; and that is
relevant to whether we want to extend the tcl_th_bndrs field (no).
* I de-crufted the code in RnEnv.extendGlobalRdrEnv, by getting rid of the
qual_gre code which said "Seems like 5 times as much work as it deserves!".
Instead, RdrName.pickGREs makes the Internal names shadow External ones.
* I moved the checkThLocalName cross-stage test to finishHsVar; previously
we weren't doing the test at all in the OpApp case!
* Quite a few changes (shortening the code) in the cross-stage checking code
in TcExpr and RnSplice, notably to move the keepAlive call to the renamer
One leftover piece:
* In TcEnv I removed tcExtendGhciEnv and refactored
tcExtendGlobalTyVars; this is really related to the next commit, but
it was too hard to disentangle.
|
|
|
|
|
|
| |
Instead of panic-ing we now give a sensible message.
There is quite a bit of refactoring here too, removing
several #ifdef GHCI things
|
| |
|
|
|
|
|
|
| |
Instead of reporting only one "module not found"" error.
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
|
|
|
|
|
|
| |
The problem was that the renamer treated role annotations by looking
up the annotated type in the module being compiled. If this check
succeeded, it was assumed that the annotated type was being compiled
at the same time. But this assumption is false! In GHCi (and Template
Haskell), sometimes compilation within one module can be staged. So,
now there is a more intricate check for orphan role annotations. This
also has the benefit of producing better error messages.
|
|
|
|
|
|
| |
We weren't dealing with built-in syntax; data constructors
that are built-in syntax (only [] actually) don't appear
in the GlobalRdrEnv
|
|
|
|
| |
This commit moves the check from parser to renamer.
|
| |
|
| |
|
|
|
|
|
| |
Since declaration splices are now untyped, they can be used anywhere a
declaration is valid, including in declaration brackets.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This structure now matches that of the type checker.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a `{-# MINIMAL #-}` pragma, which defines the possible
minimal complete definitions for a class. The body of the pragma is a
boolean formula of names.
The old warning for missing methods is replaced with this new one.
Note: The interface file format is changed to store the minimal complete
definition.
Authored-by: Twan van Laarhoven <twanvl@gmail.com>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
|
|
| |
This fixes bugs #8185, #8234, and #8246. The new syntax is explained
in the comments to #8185, appears in the "Roles" subsection of the
manual, and on the [wiki:Roles] wiki page.
This change also removes the ability for a role annotation on type
synonyms, as noted in #8234.
|
|
|
|
| |
for easier copy'n'paste. This fixes: #3647
|
|
|
|
|
| |
Authored-by: David Luposchainsky <dluposchainsky@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
| |
|
|
|
|
| |
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under -XNumDecimals, it's possible to specify an integer literal using
compact "floating point" syntax for any floating literal constant which
also happens to be an integer. This lets us write
1.2e6 :: Integer
instead of:
1200000 :: Integer
This also makes some amendments to the users guide.
Authored-by: Shachaf Ben-Kiki <shachaf@gmail.com>
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
|
|
|
|
|
| |
The `-dumpdir` flag was added via 668c860b361f16 but failed to
take care of `-ddump-minimal-imports`'s output.
This commit makes up for that omission.
This addresses #7957
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
| |
I'd still prefer if a native english speaker would check them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Roles are a solution to the GeneralizedNewtypeDeriving type-safety
problem.
Roles were first described in the "Generative type abstraction" paper,
by Stephanie Weirich, Dimitrios Vytiniotis, Simon PJ, and Steve Zdancewic.
The implementation is a little different than that paper. For a quick
primer, check out Note [Roles] in Coercion. Also see
http://ghc.haskell.org/trac/ghc/wiki/Roles
and
http://ghc.haskell.org/trac/ghc/wiki/RolesImplementation
For a more formal treatment, check out docs/core-spec/core-spec.pdf.
This fixes Trac #1496, #4846, #7148.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
You ought to be able to say
module M( C( T, foo ) where
class C a where
type T a
foo :: a -> T a
i.e. with T in C's sub-item list. This makes it so.
|
| |
|
|
|
|
|
|
|
|
| |
When we changed 'rec' to *not* do segmentation of any kind,
I did it by meddling with the inner loop of grab in glomSegments.
But that is really hard to understand!
This patch lifts the test out to the top where is is clear.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the syntax and story around overlapping type
family instances. Before, we had "unbranched" instances and
"branched" instances. Now, we have closed type families and
open ones.
The behavior of open families is completely unchanged. In particular,
coincident overlap of open type family instances still works, despite
emails to the contrary.
A closed type family is declared like this:
> type family F a where
> F Int = Bool
> F a = Char
The equations are tried in order, from top to bottom, subject to
certain constraints, as described in the user manual. It is not
allowed to declare an instance of a closed family.
|
|
|
|
|
|
| |
Clang doesn't like whitespace between macro and arguments.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
|
|
|
|
|
| |
The ideclImplicit flag didn't exist before, but it does now,
and it makes this code simpler and makes it easy to fix Trac #7963.
|
| |
|
| |
|
| |
|
|
|
|
| |
This fixes Trac #7937
|
| |
|
|
|
|
| |
Removed a definition of thenM, and used do notation instead
|
|
|
|
|
|
|
|
| |
We simply weren't quantifying kind variables at the points we
were claiming. In paritcular, in
forall (a:k). blah
we quantify the 'k' around the 'forall a', provided k isn't
already in scope
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The typechecking of arrow forms (in GHC 7.6) is known to be bogus, as
described in Trac #5609, because it marches down tuple types that may
not yet be fully worked out, depending on when constraint solving
happens. Moreover, coercions are generated and simply discarded. The
fact that it works at all is a miracle.
This refactoring is based on a conversation with Ross, where we
rearranged the typing of the argument stack, so that the arrows
have the form
a (env, (arg1, (arg2, ...(argn, ())))) res
rather than
a (arg1, (arg2, ...(argn, env))) res
as it was before.
This is vastly simpler to typecheck; just look at the beautiful,
simple type checking of arrow forms now!
We need a new HsCmdCast to capture the coercions generated from
the argument stack.
This leaves us in a better position to tackle the open arrow tickets
* Trac #5777 still fails. (I was hoping this patch would cure it.)
* Trac #5609 is too complicated for me to grok. Ross?
* Trac #344
* Trac #5333
|
|
|
|
| |
AnnProvenance now has Functor, Foldable, Traversable instances.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This work was all done by
Achim Krause <achim.t.krause@gmail.com>
George Giorgidze <giorgidze@gmail.com>
Weijers Jeroen <jeroen.weijers@uni-tuebingen.de>
It allows list syntax, such as [a,b], [a..b] and so on, to be
overloaded so that it works for a variety of types.
The design is described here:
http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists
Eg. you can use it for maps, so that
[(1,"foo"), (4,"bar")] :: Map Int String
The main changes
* The ExplicitList constructor of HsExpr gets witness field
* Ditto ArithSeq constructor
* Ditto the ListPat constructor of HsPat
Everything else flows from this.
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
compiler/rename/RnSource.lhs
compiler/simplCore/OccurAnal.lhs
compiler/vectorise/Vectorise/Exp.hs
NB: Merging instead of rebasing for a change. During rebase Git got confused due to the lack of the submodules in my quite old fork.
|