summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* Add fake entries into the global kind environment for pattern synonyms.Dr. ERDI Gergo2014-06-212-8/+16
| | | | | | This is needed to give meaningful error messages (instead of internal panics) when a program tries to lift a pattern synonym into a kind. (fixes T9161)
* Update documentation to follow 2dc3b476aff28Edward Z. Yang2014-06-201-10/+5
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Reject forall types in constraints in signaturesSimon Peyton Jones2014-06-201-3/+7
| | | | | | | Fixes Trac #9196. Thanks to archblob for an initial stab at this. In the end I fixed it in the kind checker rather than the subsequent validity check, (a) so that the error messages look more uniform, and (b) so that I did not need to meddle with isPredTy.
* Comment typoSimon Peyton Jones2014-06-201-1/+1
|
* Make splitStrProdDmd (and similarly Use) more robustSimon Peyton Jones2014-06-201-28/+24
| | | | | | | The issue here is avoiding a GHC crash when a program uses unsafeCoerce is a dangerous (or even outright-wrong) way. See Trac #9208
* Tidy up the printing of single-predicate contextsSimon Peyton Jones2014-06-204-76/+66
| | | | | | | | | | This covers things like Eq a => blah and (?x::Int) => blah where there is just one predicate. Previously we used an ad-hoc test to decide whether to parenthesise it, but acutally there is a much simpler solution: just use the existing precedence mechamism. This applies both to Type and HsType.
* A bit more tracing of functional dependenciesSimon Peyton Jones2014-06-201-1/+3
|
* Implement `Typeable` support for type-level literals (#8778).Iavor S. Diatchki2014-06-141-1/+40
|
* Remove forgotten redundant importSimon Peyton Jones2014-06-121-1/+0
|
* Fix elemLocalRdrEnv (Trac #9160)Simon Peyton Jones2014-06-121-19/+41
| | | | | | | | | | | | | | | This was pretty obscure. elemLocalRdrEnv was utterly wrong (replied False when it should reply True) when given an Exact Name. That doesn't happen often, but it does happen in the result of a TH splice. The result was that an associated type didn't get a type variable that lined up with its parent class (elemLocalRdrEnv is used in RnTypes.bindHsTyVars), and that messed up the singletons package. I've made a completely different test case to show up the bug: indexed_types/should_fail/T9160 I also refactored RdrName.LocalRdrEnv to be a record with named fields, which makes the code more robust and easy to understand.
* Line up kind and type variables correctly when desugaring TH bracketsSimon Peyton Jones2014-06-121-5/+8
| | | | This bug was causing Trac #9199
* Better debug printingSimon Peyton Jones2014-06-123-8/+23
|
* Improve IfaceSyn a bit furtherSimon Peyton Jones2014-06-123-732/+796
| | | | | | | | | | | | | | | | | | | This patch has three main bits: * The most substantial change is that IfaceConDecl no longer records its universal type variables, because they are always the same as those of the parent TyCon. A bit less fuss and clutter. * Add a synonym for IfTopBndr = OccName, and explain why it's an OccName not a FastString * Make the ifMinDef field be a (BooleanFormula IfLclName) rather than (BooleanFormula OccName). These really are occurrences (not binders), and should be treated like other occurences. The first and third change the format of interface files, so you'll need to recompile.
* Fix a serious, but rare, strictness analyser bug (Trac #9128)Simon Peyton Jones2014-06-111-1/+10
| | | | | | | | | In a special case for trivial RHSs (see DmdAnal.unpackTrivial), I'd forgotten to include a demand for the RHS itself. See Note [Remember to demand the function itself]. Thanks to David Terei for guiding me to the bug, at PLDI in Edinburgh.
* Simplify variable naming in tcDataKindSigSimon Peyton Jones2014-06-111-22/+24
| | | | | | | | | | | Now that we are very consistent about tidying when converting to IfaceSyn, we don't need to worry about accidental capture of the "extra" type variables in tcDataKindSig. (Previously we gave them weird names like $a.) However, it is nicer for the user if we don't gratuitously re-use an in-scope name, so we take care not to do that .
* Fix tyConToIfaceDecl (Trac #9190)Simon Peyton Jones2014-06-111-31/+36
| | | | | | | | | | | | | | | | | | | | | | | There are three bugs here, one serious * We were failing to tidy the type arguments in an IfTyConParent This is what was causing Trac #9190. * toIfaceTcArgs is careful to suppress kind arguments, but there was a clone, tidyToIfaceTcArgs in IfaceSyn which didn't. Now the latter goes via the former. * When pretty-printing a IfaceDecl for an algebraic data type, and doing so in Haskell-98 syntax, we were silently assuming that the universal type variables of the TyCon and the DataCon were the same. But that has not been true for some time. Result: a very confusing display. Solution: during the conversion to IfaceSyn, take the opportunity to make the universal type variables line up exactly. This is very easy to do, makes the pretty-printing easy, and leaves open the future possiblity of not serialising the universal type variables of the data constructor.
* White space onlySimon Peyton Jones2014-06-111-1/+1
|
* Improve error message in Trac #8883Simon Peyton Jones2014-06-112-37/+62
| | | | | The improvement is to report the inferred type in the error message, as suggested in email on ghc-deves (10 Jun 14).
* Some typos in commentsGabor Greif2014-06-115-6/+6
|
* Typo in variable name, no functional changeGabor Greif2014-06-111-2/+2
|
* Fix #9062.Richard Eisenberg2014-06-117-21/+19
| | | | | | | | | Removed (pprEqPred (coercionKind co)) in favor of (pprType (coercionType co)). Also had to make "~R#" a *symbolic* identifier and BuiltInSyntax to squelch prefix notation and module prefixes in output. These changes are both sensible independent of #9062.
* Fix #9085.Richard Eisenberg2014-06-111-3/+3
| | | | | Inaccessible equations in a closed type family now leads to a warning, not an error. This echoes what happens at the term level.
* Fix #9097.Richard Eisenberg2014-06-112-15/+10
| | | | `Any` is now an abstract (that is, no equations) closed type family.
* Clarify error message. See #9167.Richard Eisenberg2014-06-111-1/+1
|
* Make FunPtr's role be phantom; add comments.Richard Eisenberg2014-06-111-3/+22
| | | | | This change also updates castFunPtr to make it free at runtime. This fixes #9163.
* Make better use of the x86 addressing modeJohan Tibell2014-06-101-0/+9
| | | | | | | | | | | | | We now emit movq %rdi,16(%r14,%rsi,8) instead of leaq 16(%r14),%rax movq %rdi,(%rax,%rsi,8) This helps e.g. byte array indexing.
* Improve the API doc description of the SmallArray primitive typesDuncan Coutts2014-06-101-2/+16
| | | | | | Say how it differs from Array in terms of size and performance. These are primitives so it's also ok to talk a bit about implementation details like card tables.
* Better warning message for orphan instances (Ticket #9178)Dr. Heinrich Hördegen2014-06-091-0/+7
| | | | Including a test case.
* Suggest -fprint-explicit-kinds when only kind variables are ambiguousSimon Peyton Jones2014-06-091-14/+36
| | | | | This was triggered by looking at Trac #9171. See Note [Suggest -fprint-explicit-kinds] in TcErrors
* Check that an associated type mentions at least one type variable from the classSimon Peyton Jones2014-06-091-7/+11
| | | | Fixes Trac #9167
* Don't use showPass in the backend (#8973)Simon Marlow2014-06-084-15/+16
|
* Remove unused --run-cps/--run-cpsz optionsSimon Marlow2014-06-081-4/+0
|
* Fix obscure problem with using the system linker (#8935)Simon Marlow2014-06-081-23/+49
| | | | See Note [RTLD_LOCAL] for a summary of the problem and solution, and
* Pretty-print built in synonym families in interfacesJoachim Breitner2014-06-073-1/+8
| | | | This closes #9181.
* supress warning of bang wildcard pattern-binding (i.e. let !_ = rhs). This ↵Guido Zayas2014-06-061-2/+3
| | | | fixes #9127
* Fix discarding of unreachable code in the register allocator (#9155)Simon Marlow2014-06-062-24/+22
| | | | | | | A previous fix to this was wrong: f5879acd018494b84233f26fba828ce376d0f81d and left some unreachable code behind. So rather than try to be clever and do this at the same time as the strongly-connected-component analysis, I'm doing a separate reachability pass first.
* Only use UnicodeSytanx pretty printing if the locale supports itJoachim Breitner2014-06-063-14/+15
| | | | using the same check as for unicode quotes.
* Use UnicodeSyntax when printingJoachim Breitner2014-06-067-21/+41
| | | | | When printing Haskell source, and UnicodeSyntax is enabled, use the unicode sytax characters (#8959).
* Make DeriveTraversable imply DeriveFunctor/FoldableSjoerd Visscher2014-06-061-0/+3
| | | | Implements #9069
* Make the matcher and wrapper Ids in PatSyn into LocalIds, not GlobalIdsSimon Peyton Jones2014-06-0617-134/+155
| | | | | | | | | | | | | | | | | | | | This was a serious bug, exposed by Trac #9175. The matcher and wrapper must be LocalIds, like record selectors and dictionary functions, for the reasons now documented in Note [Exported LocalIds] in Id.lhs In fixing this I found - PatSyn should have an Id inside it (apart from the wrapper and matcher) It should be a Name. Hence psId --> psName, with knock-on consequences - Tidying of PatSyns in TidyPgm was wrong - The keep-alive set in Desugar.deSugar (now) doesn't need pattern synonyms in it I also cleaned up the interface to PatSyn a little, so there's a tiny knock-on effect in Haddock; hence the haddock submodule update. It's very hard to make a test for this bug, so I haven't.
* Report all possible results from related name spacesJoachim Breitner2014-06-062-22/+16
| | | | | instead of just one matching directly. This is an alternative way to fix ticket #9177.
* Suggest Int when user writes intJoachim Breitner2014-06-062-0/+26
| | | | and the other way around. This fixes #9177.
* TypoMateusz Kowalczyk2014-06-061-1/+1
|
* Fix compilation of cmm files with -outputdir (Trac #9050)Yuras Shumovich2014-06-051-5/+2
|
* Tweak commentsGabor Greif2014-06-051-4/+4
|
* Emit error in case of duplicate GRE; fixes #7241Yuras Shumovich2014-06-051-7/+14
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)Simon Peyton Jones2014-06-0514-82/+113
| | | | | | | | | | | | | | | We simply weren't giving anything like the right instantiating types to patSynInstArgTys in matchOneConLike. To get these instantiating types would have involved matching the result type of the pattern synonym with the pattern type, which is tiresome. So instead I changed ConPatOut so that instead of recording the type of the *whole* pattern (in old field pat_ty), it not records the *instantiating* types (in new field pat_arg_tys). Then we canuse TcHsSyn.conLikeResTy to get the pattern type when needed. There are lots of knock-on incidental effects, but they mostly made the code simpler, so I'm happy.
* Subsume NullaryTypeClasses by MultiParamTypeClasses (#8993)Owen Stephens2014-06-043-24/+17
| | | | MPTC now also handles the nullary case
* Comments only (related to Trac #7730)Simon Peyton Jones2014-06-032-4/+42
|
* Use IfLclName instead of OccName in IfaceEqSpecSimon Peyton Jones2014-06-034-9/+8
| | | | | | The type variables in the IfaceEqSpec of a data constructor are really ordinarly *occurrences*, so they should be IfLclNames just like any other type variable occurence.