summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve error message for a handwritten Typeable instanceSimon Peyton Jones2014-11-041-18/+24
|
* Define ctEvLoc and ctEvCoercion, and use themSimon Peyton Jones2014-11-042-5/+15
|
* Minor refactoring (no change in functionality)Simon Peyton Jones2014-11-041-3/+3
|
* Don't filter out allegedly-irrelevant bindings with -dppr-debugSimon Peyton Jones2014-11-041-1/+3
|
* Only report "could not deduce s~t from ..." for givens that include equalitiesSimon Peyton Jones2014-11-041-6/+8
| | | | | This just simplifies the error message in cases where there are no useful equalities in the context
* When reporting the context of given constraints, stop when you find oneSimon Peyton Jones2014-11-041-6/+17
| | | | | | that binds a variable mentioned in the wanted There is really no point in reporting ones further out; they can't be useful
* Typechecker debug tracing onlySimon Peyton Jones2014-11-044-32/+39
|
* Normalise the type of an inferred let-bindingSimon Peyton Jones2014-11-042-12/+21
| | | | | | | | | | | With the new constraint solver, we don't guarantee to fully-normalise all constraints (if doing so is not necessary to solve them). So we may end up with an inferred type like f :: [F Int] -> Bool which could be simplifed to f :: [Char] -> Bool if there is a suitable family instance declaration. This patch does this normalisation, in TcBinds.mkExport
* Get the Untouchables level right in simplifyInferSimon Peyton Jones2014-11-045-126/+179
| | | | | | | | Previously we could get constraints in which the untouchables-level did not strictly increase, which is one of the main invariants! This patch also simplifies and modularises the tricky case of generalising an inferred let-binding
* Refactor the treatment of lexically-scoped type variables for instance ↵Simon Peyton Jones2014-11-044-21/+28
| | | | | | | | | | | | | | declarations Previously the univerally-quantified variables of the DFun were also (bizarrely) used as the lexically-scoped variables of the instance declaration. So, for example, the DFun's type could not be alpha-renamed. This was an odd restriction, which has bitten me several times. This patch does the Right Thing, by adding an ib_tyvars field to the InstBindings record, which captures the lexically scoped variables. Easy, robust, nice. (I think this record probably didn't exist originally, hence the hack.)
* Refactor skolemising, and newClsInstSimon Peyton Jones2014-11-045-103/+117
| | | | | | | | | This makes newClsInst (was mkInstance) look more like newFamInst, and simplifies the plumbing of the overlap flag, and ensures that freshening (required by the InstEnv stuff) happens in one place. On the way I also tided up the rather ragged family of tcInstSkolTyVars and friends. The result at least has more uniform naming.
* Rename setRole_maybe to downgradeRole_maybeSimon Peyton Jones2014-11-041-18/+18
| | | | This change is just for naming uniformity with the existing downgradeRole
* Simplify the API for tcInstTyVars, and make it more consistent with other ↵Simon Peyton Jones2014-11-045-31/+33
| | | | similar functions
* Fix reduceTyFamApp_maybeSimon Peyton Jones2014-11-041-12/+34
| | | | | This function previously would expand *data* families even when it was asked for a *Nominal* coercion. This patch fixes it, and adds comments.
* White space onlySimon Peyton Jones2014-11-045-52/+60
|
* Add the unfolding and inline-pragma for DFuns in DsBinds, not TcInstDclsSimon Peyton Jones2014-11-042-23/+28
| | | | | This is a straight refactoring that puts the generation of unfolding info in one place, which is a lot tidier
* Simplify the generation of superclass constraints in tcInstDecl2Simon Peyton Jones2014-11-041-9/+10
| | | | | The simplified function is tcSuperClasses; no need for an implication constraint here
* Some refactoring around endPass and debug dumpingSimon Peyton Jones2014-11-0413-117/+157
| | | | | I forget all the details, but I spent some time trying to understand the current setup, and tried to simplify it a bit
* Improve pretty-printing of type variablesSimon Peyton Jones2014-11-041-10/+10
| | | | | In particular, print a bit of debug info in debug-style and dump-style Otherwise distinct type variables look the same
* Tidy up pretty-printing of SrcLoc and SrcSpanSimon Peyton Jones2014-11-041-46/+55
|
* Add GHC.Prim.oneShotJoachim Breitner2014-11-022-3/+42
| | | | | | | | | | | to allow the programer to explictitly set the oneShot flag. This helps with #7994 and will be used in left folds. Also see https://ghc.haskell.org/trac/ghc/wiki/OneShot This commit touches libraries/base/GHC/Event/Manager.hs (which used to have a local definition of the name oneShot) to avoid a shadowing error. Differential Revision: https://phabricator.haskell.org/D392
* Put one-Shot info in the interfaceJoachim Breitner2014-11-025-19/+69
| | | | Differential Revision: https://phabricator.haskell.org/D391
* Tweak the error message for pattern synonym methods,Dr. ERDI Gergo2014-11-021-1/+1
| | | | since they are disallowed both in class and instance declarations
* Fix #9738, by handling {-# ANN ... #-} in DsMeta.Richard Eisenberg2014-11-011-20/+56
|
* Fix #9084 by calling notHandled when unknown bits are enountered.Richard Eisenberg2014-11-011-19/+60
|
* Annotate poly-kinded type patterns in instance reification.Richard Eisenberg2014-11-011-19/+72
| | | | This should fix #8953.
* Annotate reified poly-kinded tycons when necessary. (#8953)Richard Eisenberg2014-11-011-3/+69
|
* Always use KindedTV when reifying. (#8953)Richard Eisenberg2014-11-011-3/+4
|
* Bring unbound tyvars into scope during reifyInstances.Richard Eisenberg2014-11-012-14/+23
| | | | Fix #9262.
* rnMethodBind: reject pattern synonyms in instance definitions (fixes #9705)Dr. ERDI Gergo2014-11-011-0/+10
|
* Remove legacy support for -optdef flagsThomas Miedema2014-10-311-24/+4
| | | | | | | | | | | | | | Summary: -optdef flags were deprecated in or before 2008 Reviewers: austin Reviewed By: austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D409 GHC Trac Issues: #2773
* remove old .NET related codeYuras Shumovich2014-10-3111-114/+6
| | | | | | | | | | | | | | Summary: It seems to be dead anyway. Also update Haddock submodule. Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: thomie, goldfire, carter, simonmar Differential Revision: https://phabricator.haskell.org/D357
* Fix comment typosJan Stolarek2014-10-312-3/+3
|
* Comments onlyJan Stolarek2014-10-301-1/+1
|
* Add __GLASGOW_HASKELL_TH__=YES/NO to CPP definitionsJoachim Breitner2014-10-291-0/+6
| | | | | | | | | | | | | | Test Plan: None really. Reviewers: austin Reviewed By: austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D386 GHC Trac Issues: #9734
* Convert GHCi sources from .lhs to .hsRodlogic2014-10-297-151/+93
| | | | | | | | | | | | | | Summary: Signed-off-by: Rodlogic <admin@rodlogic.net> Test Plan: Does it compile? Reviewers: hvr, austin Reviewed By: austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D319
* Typo in commentGabor Greif2014-10-281-2/+2
|
* Un-wire `Integer` type (re #9714)Herbert Valerio Riedel2014-10-274-80/+70
| | | | | | | | | | | | | | Integer is currently a wired-in type for integer-gmp. This requires replicating its inner structure in `TysWiredIn`, which makes it much harder to change Integer to a more complex representation (as e.g. needed for implementing #9281) This commit stops `Integer` being a wired-in type, and makes it known-key type instead, thereby simplifying code notably. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D351
* fix a typo in comments: normaliseFfiTypeYuras Shumovich2014-10-241-1/+1
| | | | | | | | | | | | | | Summary: The function is defined in TcForeign module, but misspelled comment makes it hard to find Reviewers: austin Reviewed By: austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D368
* Implementation of hsig (module signatures), per #9252Edward Z. Yang2014-10-2426-202/+745
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Module signatures, like hs-boot files, are Haskell modules which omit value definitions and contain only signatures. This patchset implements one particular aspect of module signature, namely compiling them against a concrete implementation. It works like this: when we compile an hsig file, we must be told (via the -sig-of flag) what module this signature is implementing. The signature is compiled into an interface file which reexports precisely the entities mentioned in the signature file. We also verify that the interface is compatible with the implementation. This feature is useful in a few situations: 1. Like explicit import lists, signatures can be used to reduce sensitivity to upstream changes. However, a signature can be defined once and then reused by many modules. 2. Signatures can be used to quickly check if a new upstream version is compatible, by typechecking just the signatures and not the actual modules. 3. A signature can be used to mediate separate modular development, where the signature is used as a placeholder for functionality which is loaded in later. (This is only half useful at the moment, since typechecking against signatures without implementations is not implemented in this patchset.) Unlike hs-boot files, hsig files impose no performance overhead. This patchset punts on the type class instances (and type families) problem: instances simply leak from the implementation to the signature. You can explicitly specify what instances you expect to have, and those will be checked, but you may get more instances than you asked for. Our eventual plan is to allow hiding instances, but to consider all transitively reachable instances when considering overlap and soundness. ToDo: signature merging: when a module is provided by multiple signatures for the same base implementation, we should not consider this ambiguous. ToDo: at the moment, signatures do not constitute use-sites, so if you write a signature for a deprecated function, you won't get a warning when you compile the signature. Future work: The ability to feed in shaping information so that we can take advantage of more type equalities than might be immediately evident. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate and new tests Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, ezyang, carter, goldfire Differential Revision: https://phabricator.haskell.org/D130 GHC Trac Issues: #9252
* Enabled warn on tabs by default (fixes #9230)Mateusz Lenik2014-10-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: This revision enables -fwarn-tabs by default and add a suppression flag, so that GHC compilation won't fail when some files contain tab characters. Test Plan: Additional test case, T9230, was added to cover that change. Reviewers: austin Reviewed By: austin Subscribers: simonmar, ezyang, carter, thomie, mlen Differential Revision: https://phabricator.haskell.org/D255 GHC Trac Issues: #9230 Conflicts: testsuite/driver/testlib.py
* Fixes the ARM buildMoritz Angermann2014-10-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: CodeGen.Platform.hs was changed with the following diff: -#endif globalRegMaybe _ = Nothing +#elif MACHREGS_NO_REGS +globalRegMaybe _ = Nothing +#else +globalRegMaybe = panic "globalRegMaybe not defined for this platform" +#endif which causes globalRegMaybe ot panic for arch ARM. This patch ensures globalRegMaybe is not called on ARM. Signed-off-by: Moritz Angermann <moritz@lichtzwerge.de> Test Plan: Building arm cross-compiler (e.g. --target=arm-apple-darwin10) Reviewers: hvr, ezyang, simonmar, rwbarton, austin Reviewed By: austin Subscribers: dterei, bgamari, simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D208 GHC Trac Issues: #9593
* Reify data family instances correctly.Richard Eisenberg2014-10-211-1/+9
| | | | | | | | | | | | | | | | Summary: Fix #9692. The reifier didn't account for the possibility that data/newtype instances are sometimes eta-reduced. It now eta-expands as necessary. Test Plan: th/T9692 Reviewers: simonpj, austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D355
* Clarify location of Note. Comment change only.Richard Eisenberg2014-10-211-1/+1
|
* Revert "Place static closures in their own section."Edward Z. Yang2014-10-2010-19/+4
| | | | | | | | | | This reverts commit b23ba2a7d612c6b466521399b33fe9aacf5c4f75. Conflicts: compiler/cmm/PprCmmDecl.hs compiler/nativeGen/PPC/Ppr.hs compiler/nativeGen/SPARC/Ppr.hs compiler/nativeGen/X86/Ppr.hs
* Revert "BC-breaking changes to C-- CLOSURE syntax."Edward Z. Yang2014-10-203-13/+10
| | | | This reverts commit 3b5a840bba375c4c4c11ccfeb283f84c3a1ef22c.
* Revert "Properly generate info tables for static closures in C--."Edward Z. Yang2014-10-202-5/+3
| | | | This reverts commit 178eb9060f369b216f3f401196e28eab4af5624d.
* Revert "Rename _closure to _static_closure, apply naming consistently."Edward Z. Yang2014-10-204-9/+9
| | | | | | | This reverts commit 35672072b4091d6f0031417bc160c568f22d0469. Conflicts: compiler/main/DriverPipeline.hs
* Indentation and non-semantic changes only.Edward Z. Yang2014-10-195-103/+107
| | | | | | | | | | | | | | | Summary: Get these lines fitting in 80 columns, and replace ptext (sLit ...) with text Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: thomie, carter, ezyang, simonmar Differential Revision: https://phabricator.haskell.org/D342
* Remove obsolete Data.OldTypeable (#9639)Michael Karg2014-10-184-178/+6
| | | | | | | | | | | | This finally removes the `Data.OldTypeable` module (which has been deprecated in 7.8), from `base`, compiler and testsuite. The deprecated `Typeable{1..7}` aliases in `Data.Typeable` are not removed yet in order to give existing code a bit more time to adapt. Reviewed By: hvr, dreixel Differential Revision: https://phabricator.haskell.org/D311