summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant SOURCE importSimon Jakobi2018-10-262-6/+1
|
* Fix nasty bug in the type free-var finder, at lastSimon Peyton Jones2018-10-268-22/+104
| | | | | | | | | | | | | | | | | | | | | Consider the type forall k. b -> k where b :: k -> Type Here the 'k' in b's kind must be a different 'k' to the forall k, because 'b' is free in the expression. So we must return 'k' among the free vars returned from tyCoVarsOfType applied that type. But we weren't. This is an outright bug, although we don't have a program that fails because of it. It's easy to fix, too: see TyCoRep Note [Closing over free variable kinds] This fix has been in the pipeline for ages because it fell into the Trac #14880 swamp. But this patch nails it.
* Fix generalisation for type constructorsSimon Peyton Jones2018-10-262-64/+86
| | | | | | | | | Fixing the way that we close-over-kinds when taking the free vars of a type revealed that the way we generalise type constructors was a bit wrong. This fixes it. See TcTyClDecls Note [Generalisation for type constructors]
* De-monadise the 'extract' functions in RnTypesSimon Peyton Jones2018-10-263-111/+102
| | | | | | | | | | | As Trac #15765 says, Once upon a time, the extract functions at the bottom of RnTypes were pure. Then, along came -XTypeInType, which needed to do a check in these functions for users mixing type variables with kind variables. Now, however, with -XTypeInType gone again, we no longer do this check. Thus, there is no reason to keep these functions monadic.
* A little more wibbling to -ddump-typesSimon Peyton Jones2018-10-253-2/+5
|
* Update core-spec for Coercion QuantificationNingning Xie2018-10-253-2/+12
| | | | | | | | | | | | | | | | | | Summary: Update details for `ForAllTy` and `ForAllCo` in core-spec, as they can now quantify over coercion variables. Test Plan: Please read core-spec.pdf Reviewers: goldfire, simonpj, bgamari Reviewed By: goldfire Subscribers: rwbarton, carter GHC Trac Issues: #15497, #15589 Differential Revision: https://phabricator.haskell.org/D5247
* Fix comment in TcTypeSimon Peyton Jones2018-10-251-20/+5
|
* Improve comments, triggered by Trac #15135Simon Peyton Jones2018-10-252-13/+22
|
* Improve documentation about overlapping instancesSimon Peyton Jones2018-10-251-14/+36
| | | | An attempt to help with Trac #15800
* Remove a zonkTcTyVarToTyVarSimon Peyton Jones2018-10-254-24/+62
| | | | | | | | | | | | This patch fixes Trac #15778 by removing a zonkTcTyVarToTyVar from tcHsSigType. Nww that a pattern-bound type variable can refer to a type, it's obvoiusly wrong to expect it to be a TyVar! Moreover, that zonk is entirely unnecessary. I added a new Note [Type variables in the type environment] in TcRnTypes
* Add comments for StgCse and UnariseSimon Peyton Jones2018-10-252-0/+18
| | | | This just improves docmentation for the fix to Trac #15300
* Test Trac #15648Simon Peyton Jones2018-10-254-0/+61
|
* Fix some broken links (#15733)Fangyi Zhou2018-10-254-4/+4
| | | | | | | | | | | | | | | | Change some URLs from hackage.haskell.org/trac to ghc.haskell.org/trac Test Plan: manually verify links work Reviewers: bgamari, simonmar, mpickering Reviewed By: bgamari, mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #15733 Differential Revision: https://phabricator.haskell.org/D5257
* Remove unnecessary free-var-set deletionSimon Peyton Jones2018-10-243-12/+11
| | | | | | | In TcSimplify.neededEvVars, in add_implic_seeds we were deleting the 'givens'; but they are already deleted, so this is a no-op. This patch just remove the redundant delete.
* Wibble report a wantedSimon Peyton Jones2018-10-241-1/+4
|
* Add HasDebugCallStack to ctEvCoecionSimon Peyton Jones2018-10-241-1/+1
| | | | This is a debug-only change
* Report a Wanted error even if there are Given onesSimon Peyton Jones2018-10-245-10/+35
| | | | | | | | | | | | | | | We suppress some Given errors; see Note [Given errors] in TcErrors. But we must be careful not to suppress Wanted errors because of the presence of these Given errors -- else we might allow compilation to bogusly proceed The rubber hits the road in TcRnTypes.insolubleCt, where we don't want to treat Givens as insoluble, nor (and this is the new bit) Deriveds that arise from Givens. See Note [Given insolubles] in TcRnTypes. This fixes #15767.
* Don't print out undefined coercionsSimon Peyton Jones2018-10-242-1/+5
| | | | | | | | | | A debug-print was trying to print the coercion returned by the flattener. But that coercion can be undefined in the case of Derived constraints. Because we might rewrite it with [D] a ~ ty, and there is no evidence for that. Solution: don't attempt to print the coercion.
* Solve equalities in a pattern signatureSimon Peyton Jones2018-10-244-2/+53
| | | | | | | | Trac #15694 showed that we were forgetting to solve the equalities of a pattern signature until too late. Result: WARNINGs and a panic: "Type-correct unfilled coercion hole"
* Refactor the treatment of predicate typesSimon Peyton Jones2018-10-2417-120/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trac #15648 showed that GHC was a bit confused about the difference between the types for * Predicates * Coercions * Evidence (in the typechecker constraint solver) This patch cleans it up. See especially Type.hs Note [Types for coercions, predicates, and evidence] Particular changes * Coercion types (a ~# b) and (a ~#R b) are not predicate types (so isPredTy reports False for them) and are not implicitly instantiated by the type checker. This is a real change, but it consistently reflects that fact that (~#) and (~R#) really are different from predicates. * isCoercionType is renamed to isCoVarType * During type inference, simplifyInfer, we do /not/ want to infer a constraint (a ~# b), because that is no longer a predicate type. So we 'lift' it to (a ~ b). See TcType Note [Lift equality constaints when quantifying] * During type inference for pattern synonyms, we need to 'lift' provided constraints of type (a ~# b) to (a ~ b). See Note [Equality evidence in pattern synonyms] in PatSyn * But what about (forall a. Eq a => a ~# b)? Is that a predicate type? No -- it does not have kind Constraint. Is it an evidence type? Perhaps, but awkwardly so. In the end I decided NOT to make it an evidence type, and to ensure the the type inference engine never meets it. This made me /simplify/ the code in TcCanonical.makeSuperClasses; see TcCanonical Note [Equality superclasses in quantified constraints] Instead I moved the special treatment for primitive equality to TcInteract.doTopReactOther. See TcInteract Note [Looking up primitive equalities in quantified constraints] Also see Note [Evidence for quantified constraints] in Type. All this means I can have isEvVarType ty = isCoVarType ty || isPredTy ty which is nice. All in all, rather a lot of work for a small refactoring, but I think it's a real improvement.
* Improve output from -ddump-typesSimon Peyton Jones2018-10-2459-207/+119
| | | | | | | | | | | | | | | | | | This patch makes a number of improvements to the output generated by -ddump-types * Prints data constructor separately * Omits empty chunks of output I was driven initially by the unhelpful existing output for data constructors, but ended up doing some refactoring. Lots of error message wibbles, but nothing significant. Certainly no change in user behaviour. (NB: It is just possible that I have failed to cleanly separate this patch from the next one, about isPredTy and friends.)
* Comments and white spaceSimon Peyton Jones2018-10-241-3/+2
|
* Fix #15792 by not reifying invisible arguments in AppTysRyan Scott2018-10-245-5/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The `reifyType` function in `TcSplice` is carefully designed to avoid reifying visible arguments to `TyConApp`s. However, the same care was not given towards the `AppTy` case, which lead to #15792. This patch changes to the `AppTy` case of `reifyType` so that it consults the kind of the function type to determine which of the argument types are invisible (and therefore should be dropped) during reification. This required crafting a variant of `tyConArgFlags`, which I dubbed `appTyArgFlags`, that accept an arbitrary function `Type` instead of a `TyCon`. Test Plan: make test TEST=T15792 Reviewers: goldfire, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, carter GHC Trac Issues: #15792 Differential Revision: https://phabricator.haskell.org/D5252
* Keep top-level names in typed TH quotes aliveRyan Scott2018-10-244-7/+28
| | | | | | | | | | | | | | | | | | | | Summary: When renaming untyped TH quotes, some care is taken to ensure that uses of top-level names in quotes do not have their bindings discarded during desugaring. The same care was not applied to typed TH quotes, so this patch brings the two into sync. Test Plan: make test TEST=T15783 Reviewers: bgamari, mpickering Reviewed By: mpickering Subscribers: mpickering, rwbarton, carter GHC Trac Issues: #15783 Differential Revision: https://phabricator.haskell.org/D5248
* Fix #15781 by using ktypedocs on type synonym RHSesRyan Scott2018-10-245-19/+65
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a follow-up to D5173, which permitted unparenthesized kind signatures in certain places. One place that appeared to be overlooked was the right-hand sides of type synonyms, which this patch addresses by introducing a `ktypedoc` parser production (which is to `ctypdoc` as `ktype` is to `ctype`) and using it in the right place. Test Plan: make test TEST="KindSigs T15781" Reviewers: harpocrates, bgamari Reviewed By: harpocrates Subscribers: rwbarton, mpickering, carter GHC Trac Issues: #15781 Differential Revision: https://phabricator.haskell.org/D5245
* Trigger multiline mode in GHCi on '\case' (#13087)Alec Theriault2018-10-246-0/+31
| | | | | | | | | | | | | | | | | | | Summary: In ALR, 'ITlcase' should expect an opening curly. This is probably a forgotten edge case in ALR, since `maybe_layout` (which handles the non-ALR layout) already deals with the 'ITlcase' token properly. Test Plan: make TEST=T10453 && make TEST=T13087 Reviewers: bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: RyanGlScott, rwbarton, carter GHC Trac Issues: #10453, #13087 Differential Revision: https://phabricator.haskell.org/D5236
* Bump hsc2hs submoduleBen Gamari2018-10-231-0/+0
|
* Add 'hadrian/' from commit '45f3bff7016a2a0cd9a5455a882ced984655e90b'Ben Gamari2018-10-23110-0/+10131
|\ | | | | | | | | | | git-subtree-dir: hadrian git-subtree-mainline: 575b35f4cdc18045bccd42d341d6f25d95c0696c git-subtree-split: 45f3bff7016a2a0cd9a5455a882ced984655e90b
| * Fix warnings, improve documentationAndrey Mokhov2018-10-202-27/+58
| |
| * Bump QuickCheck boundAndrey Mokhov2018-10-201-1/+1
| |
| * Merge pull request #700 from snowleopard/alp/ghc-versions-ciAlp Mestanogullari2018-10-091-15/+15
| |\ | | | | | | update GHC versions used on travis
| | * update GHC versions used on travisAlp Mestanogullari2018-10-091-15/+15
| |/ | | | | I saw that (nightly) travis builds are failing because we now only support 8.4 or higher to boot a GHC HEAD build. I don't know how to achieve this for the OS X section though.
| * Honour the flavours advertised by the flavours.md document (#691)Alp Mestanogullari2018-10-0211-43/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | * honour the flavours advertised by our flavours.md document In particular, this patches focuses on enabling back the dynamic-enabled ways for the runtime system, which required to fix a bug in libsuf. * address some feedback * make dynamicGhcPrograms :: Action Bool to implement the default logic faithfully * remove redundant windows check
| * Pass 'threaded' flag to the GHC executable (#689)Alp Mestanogullari2018-10-011-1/+5
| |
| * Simplify oracles (#694)Andrey Mokhov2018-09-302-16/+3
| | | | | | | | As discussed in #550, we can remove some unnecessary occurrences of `newCache`.
| * Rework parsing of Cabal metadata (#692)Andrey Mokhov2018-09-2932-389/+484
| | | | | | | | | | The current implementation of parsing Cabal data is a big mess, which affects performance as described in #671 and #550. In this PR we simplify the implementation and avoid unnecessary reparsing. As a result, the zero build time is reduced from 30 seconds to 5 seconds on my machine. The full build time seems to have been improved as well, since now all CI bots complete within the time limit. On the other hand, the speed up of the full build with `-j` on my machine does not appear to be significant.
| * Build touchy and unlit only in Stage0, copy binaries for later stages (#693)Alp Mestanogullari2018-09-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | * unlit: build only in stage0, copy that binary for later stages (fixes #595) * add missing condition We only want this "optimisation" for unlit. * compare 'Package's instead of strings * same optimisation for touchy
| * OS X CI scripts: don't use my GHC branch anymore, D5138 has been merged (#690)Alp Mestanogullari2018-09-132-6/+1
| |
| * Add unlit to testsuitePackages (#688)Alp Mestanogullari2018-09-131-1/+2
| |
| * Fix a logic error that kept us from building/linking object files for many ↵Alp Mestanogullari2018-09-121-1/+1
| | | | | | | | ways (#687)
| * Set integer-gmp flag when appropriate (#684)Alp Mestanogullari2018-09-121-2/+3
| | | | | | | | | | | | * set integer-gmp flag when appropriate, when building the compiler lib * address Andrey's feedback
| * Build more profiling ways by default (#682)Alp Mestanogullari2018-09-101-1/+6
| | | | | | See #681
| * Move to GHC 8.4.3 by upgrading the Stackage snapshot (#680)Neil Mitchell2018-09-071-1/+1
| |
| * Fix clean so it works on Windows (#679)Neil Mitchell2018-09-071-1/+3
| |
| * Update OS X scripts to test a GHC patch for #614 (#678)Alp Mestanogullari2018-09-072-1/+5
| | | | | | | | | | | | * .travis.yml: update OS X script to test a GHC patch for #614 * circle.yml: update script to test GHC patch for #614
| * Make the test rule depend on ghc-compact, to make this library's tests pass ↵Alp Mestanogullari2018-09-062-8/+2
| | | | | | | | | | (#677) This fixes all the failing ghc-compact tests (quite likely all of them, since they presumably all need the library), and also removes some leftover from the previous PR #676.
| * Work around the "can't use Natural in base" problem on a per-flavour basis ↵Alp Mestanogullari2018-09-056-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#676) * Work around the "can't use natural in base" problem on a per-flavour basis The only flavours that need the workaround are the ones that build GHC/{Natural, Num}.hs with -O0, namely 'quick', 'quickest' and 'prof'. This patches defines the necessary arguments in one place and uses them in all the aforementionned flavour definitions. This will allow us to have both quick/quickest/prof builds that come through as well as an efficient compiler when we want it (with e.g perf), which wasn't the case before my series of patches for this problem. * address @snowleopard's feedback
| * Remove unwanted '-O0's in Settings.Packages (#674)Alp Mestanogullari2018-09-051-5/+4
| |
| * Fix typosAndrey Mokhov2018-09-041-12/+11
| |
| * Address some issues with the testsuite rules (#672)Alp Mestanogullari2018-09-033-7/+9
| | | | | | | | The driver was invoked with invalid syntax for some arguments, we were not making sure hsc2hs is built before we run the tests (it's needed by many), etc.