summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Wibbles in response to Richard's commentswip/T9858-typeable-spjSimon Peyton Jones2015-04-1412-31/+63
|
* Remove a redndant 'return'Simon Peyton Jones2015-03-261-2/+1
|
* Error message wibblesSimon Peyton Jones2015-03-2669-356/+493
| | | | | | | | These are associated with - new instance reporting - typeable changes in -ddump-simpl output - -ddump-types being a bit less verbose - some renaming of type variables in debugger output (no idea why this happens)
* Generate Typeble info at definition sitesSimon Peyton Jones2015-03-2651-1488/+2183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the idea floated in #9858, namely that we should generate type-representation information at the data type declaration site, rather than when solving a Typeable constraint. However, this turned out quite a bit harder than I expected. I still think it's the right thing to do, and it's done now, but it was quite a struggle. See particularly * Note [Grand plan for Typeable] in TcTypeable (which is a new module) * Note [The overall promotion story] in DataCon (clarifies existing stuff) The most painful bit was that to generate Typeable instances (ie TyConRepName bindings) for every TyCon is tricky for types in ghc-prim etc: - we need to have enough data types around to *define* a TyCon - many of these types are wired-in Also, to minimise the code generated for each data type, I wanted to generate pure data, not CAFs with unpackCString# stuff floating about. Performance ~~~~~~~~~~~ Three perf/compiler tests start to allocate quite a bit more. This isn't surprising, because they all allocate zillions of data types, with practically no other code, esp T1969 T1969: GHC allocates 30% more T5642: GHC allocates 14% more T9872d: GHC allocates 5% more I'm treating this as acceptable. The payoff comes in Typeable-heavy code. Remaining to do ~~~~~~~~~~~~~~~ * I think that "TyCon" and "Module" are over-generic names to use for the runtime type representations used in GHC.Typeable. Better might be "TrTyCon" and "TrModule". But I have not yet done this * Add more info the the "TyCon" e.g. source location where it was defined * Use the new "Module" type to help with Trac #10068 * It would be possible to generate TyConRepName (ie Typeable instances) selectively rather than all the time. We'd need to persist the information in interface files. Lacking a motivating reason I have not done this, but it would not be difficult. Refactoring ~~~~~~~~~~~ As is so often the case, I ended up refactoring more than I intended. In particular * In TyCon, - a type *family* (whether type or data) is repesented by a FamilyTyCon - a algebraic data type (including data/newtype instances) is represented by AlgTyCon This wasn't true before; a data family was represented as an AlgTyCon. There are some corresponding changes in IfaceSyn. Also get rid of the (unhelpfully named) tyConParent. * In TyCon define 'Promoted', isomorphic to Maybe, used when things are optionally promoted; and use it elsewhere in GHC. * Each TyCon, including promoted TyCons, contains its TyConRepName, if it has one. This is, in effect, the name of its Typeable instance. * I added PatSynId, DefMethId, and ReflectionId to the IdInfo.IdDetails type. They are used for debugging only, namely to suppress excessive output in -ddump-types. * Tidy up the generation of PrelInfo.knownKeyNames * Move newImplicitBinder from IfaceEnv to BuildTyCl * PrelNames.conName renamed to dcQual for consistency with varQual, tcQual * Move mkDefaultMethodIds, mkRecSelBinds from TcTyClsDecls to TcTyDecls
* tcRnDeclsi can use tcRnSrcDeclsSimon Peyton Jones2015-03-261-39/+3
| | | | | I'm not sure why tcRnDeclsi didn't call tcRnSrcDecls before, but now it does. About 20 lines of code vanish. Hooray.
* Implement lookupGlobal in TcEnv, and use itSimon Peyton Jones2015-03-263-14/+35
| | | | | This localises the (revolting) initTcForLookup function, exposing instead the more civilised interface for lookupGlobal
* Comments and white spaceSimon Peyton Jones2015-03-263-5/+6
|
* Improve the error messages for class instance errorsSimon Peyton Jones2015-03-264-18/+107
| | | | See Note [Displaying potential instances].
* Add Monad instance for `((,) a)` (#10190)Fumiaki Kinoshita2015-03-255-1/+8
| | | | | | | | | | | This was proposed a couple of times in the past, e.g. - https://mail.haskell.org/pipermail/libraries/2011-November/017153.html - https://mail.haskell.org/pipermail/libraries/2013-July/020446.html but its implementation had been blocked by the fact that `Monoid` wasn't in scope where the `Monad` class was defined. Since the AMP/FTP restructuring this is no longer the case.
* More comments (related to Trac #10180)Simon Peyton Jones2015-03-243-41/+65
|
* Improve environment handling in TcBindsSimon Peyton Jones2015-03-2410-175/+193
| | | | | | | | | This is a minor refactoring, but it simplifies the code quite a bit * Decrease the number of variants of tcExtend in TcEnv * Remove "not_actually_free" from TcEnv.tc_extend_local_env2 * Simplify plumbingof the "closed" flag * Remove redundant scoping of wild-card variables
* Some stress tests for the empty case linterJoachim Breitner2015-03-242-0/+28
| | | | | | | | | | | This is a variation of T2431 where the emptyness of the type is hidden behind a newtype, a type family and a closed type family. In all cases, it would be sound for the compiler to determine that the equality type is empty and the case alternatives may be dropped. At the moment, GHC does _not_ determine that. But if it ever does, this test ensures that we do not forget to make the lint from #10180 smarter as well.
* Delete DynFlag for NDP wayThomas Miedema2015-03-241-13/+0
| | | | | | | | | | | | The last trace of NDP was removed in 2008 in commit: 44ee866e5bc20fcdf29ab13ea050816da9faf915 NDP stood for 'Nested Data Parallelism'. It was superseded by Data Parallel Haskell (DPH). Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D752
* Empty alternative lint check: Explain why there are two checksJoachim Breitner2015-03-241-0/+9
| | | | | This addresses https://ghc.haskell.org/trac/ghc/ticket/10180#comment:6 [skip ci]
* exprIsBottom: Make use of isEmptyTy (#10186)Joachim Breitner2015-03-242-1/+5
| | | | | | | | Any expression with of empty type is necessary bottom, so we can use that here. No effects known, but it is the right thing to do and validate, so lets do it. Differential Revision: https://phabricator.haskell.org/D754
* Fix bug in hs-libraries field munging.Edward Z. Yang2015-03-231-1/+2
| | | | | | | | | | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate with 7.8 stage0 and HEAD stage0 Reviewers: austin, kgardas Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D740
* Do version specific detection of LLVM tools (#10170).Erik de Castro Lopo2015-03-242-30/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | The LLVM developers seem to make breaking changes in the LLVM IR language between major releases. As a consumer of the LLVM tools GHC now needs to be locked more tightly to a single version of the LLVM tools. GHC HEAD currently only supports LLVM version 3.6. This commit changes the configure script to look for `llc-3.6` and `opt-3.6` before looking for `llc` and `opt`. If the former are not found, but the later are, check that they actually are version 3.6. At the same time, when detecting known problems with the LLVM tools (ie #9439) test for it using the versions of the LLVM tools retrieved from the bootstrap compiler's settings file. Test Plan: Manual testing. Reviewers: thomie, rwbarton, nomeata, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D745 GHC Trac Issues: #10170
* isEmptyTy: Improve commentJoachim Breitner2015-03-231-1/+3
| | | | [skip ci]
* Add Note [No alternatives lint check]Joachim Breitner2015-03-232-1/+17
| | | | in a follow up to #10180.
* New lint check: Check idArity invariants (#10181)Joachim Breitner2015-03-232-2/+22
| | | | | | | | | The arity of an id should not be larger than what the type allows, and it should also not contradict the strictness signature. This adds a lint check for that. This broke test T8743, uncovering a bug in the SOURCE import machinery, which is now filed as #10182.
* New Lint check: no alternatives implies bottoming expressionJoachim Breitner2015-03-232-1/+25
| | | | | | detected either by exprIsBottom or by an empty type. This was suggested by SPJ and fixes #10180.
* exprIsBottom should look through type lambdasJoachim Breitner2015-03-231-0/+1
| | | | | as evaluting (\ (@ a) -> e) diverges if and only if evaluating e diverges. This was found in the context of #10180.
* Do proper depth checking in the flattener to avoid looping.Richard Eisenberg2015-03-2359-1048/+1136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements (roughly) the plan put forward in comment:14:ticket:7788, fixing #7788, #8550, #9554, #10139, and addressing concerns raised in #10079. There are some regressions w.r.t. GHC 7.8, but only with pathological type families (like F a = F a). This also (hopefully -- don't have a test case) fixes #10158. Unsolved problems include #10184 and #10185, which are both known deficiencies of the approach used here. As part of this change, the plumbing around detecting infinite loops has changed. Instead of -fcontext-stack and -ftype-function-depth, we now have one combined -freduction-depth parameter. Setting it to 0 disbales the check, which is now the recommended way to get (terminating) code to typecheck in releases. (The number of reduction steps may well change between minor GHC releases!) This commit also introduces a new IntWithInf type in BasicTypes that represents an integer+infinity. This type is used in a few places throughout the code. Tests in indexed-types/should_fail/T7788 indexed-types/should_fail/T8550 indexed-types/should_fail/T9554 indexed-types/should_compile/T10079 indexed-types/should_compile/T10139 typecheck/should_compile/T10184 (expected broken) typecheck/should_compile/T10185 (expected broken) This commit also changes performance testsuite numbers, for the better.
* Make testsuite driver Python 2.6 compatible againThomas Miedema2015-03-231-8/+8
| | | | | | | | | | | | | Another bug in the #10164 series. Only Python 2.7 and up allow you to omit the positional argument specifiers in format strings. Test Plan: this fixes the Solaris builders Reviewed By: kgardas Differential Revision: https://phabricator.haskell.org/D750 GHC Trac Issues: #10164
* Update base changelog regarding 4.8.1 changesHerbert Valerio Riedel2015-03-231-3/+27
| | | | | | | Turns out we've been a bit too lazy and quite a few undocumented changes have accumulated in `base` relative to GHC 7.10's `base-4.8.0.0`... [skip ci]
* Minor bump `base` version to 4.8.1.0Herbert Valerio Riedel2015-03-2369-77/+83
| | | | | We've accumulated enough to justify a minor version bump to 4.8.1.0, but not enough to justify a major version bump yet as far as I can see.
* Fix quasiquotation test (#4150)Thomas Miedema2015-03-231-1/+1
|
* Minor fix to Note [Trimming arity]Joachim Breitner2015-03-231-1/+1
| | | | [ci skip]
* Fix integer-gmp source tarball distributionHerbert Valerio Riedel2015-03-232-0/+528
| | | | | | The `configure` script checks for presence of `install-sh` even if it's not used, so we simply add it to the distribution to make `configure` happy.
* Update integer-gmp2's changelog for releaseHerbert Valerio Riedel2015-03-231-1/+1
| | | | | | [skip ci] (cherry picked from commit 7bd3efe3ccc6dc0a3ec84008285b4e03b48d8f41)
* rts: check arguments to flags that don't have anyCarlos Tomé2015-03-234-7/+49
| | | | | | | | | | | | | | | | There were some flags of the RTS that when given an argument (which they don't have) were not firing an error. e.g -Targument when the flag -T has no argument. Now this is an error and affects the following flags: -B -w -T -Z -P -Pa -c -t Signed-off-by: Carlos Tomé <carlostome1990@gmail.com> Reviewed By: austin, thomie, hvr Differential Revision: https://phabricator.haskell.org/D748 GHC Trac Issues: #9839
* fix bus error (misaligned data access) on SPARC in __decodeDouble_Int64Karel Gardas2015-03-221-3/+3
| | | | | | | | Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D749
* docs: make gen_contents_index --verbose more verboseAustin Seipp2015-03-221-1/+3
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Trim Call ArityJoachim Breitner2015-03-222-6/+47
| | | | | | | to not accidentially invalidate a strictness signature with a Diverges result info. This seems to fix #10176. Differential Revision: https://phabricator.haskell.org/D747
* Test case for #10176Joachim Breitner2015-03-222-0/+35
| | | | | originally provided by Neil Mitchell. Despite what he observed, I can observe the bug even with all in one module.
* New lint check: exprIsHNF = True and alts = [] is bogusJoachim Breitner2015-03-221-0/+3
|
* Clarify meaning of the RTS `taskCount` variableThomas Miedema2015-03-221-1/+1
| | | | | | | | | | | | | | | | | | | In #9261, there was some confusion about the meaning of the taskCount stats variable in the rts. It turns out that taskCount is not decremented when a worker task is stopped (i.e. from workerTaskStop), but only when freeMyTask is called, which frees the task bound to the current thread. So taskCount is the current number of bound tasks + the total number of worker tasks. This makes the calculation of the current number of bound tasks in rts/Stats.c correct _as is_. [skip ci] Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D746
* Update haskeline submodule to 0.7.2.1 release tagHerbert Valerio Riedel2015-03-221-0/+0
| | | | | | This fixes compilation under windows with pre-AMP GHCs although it's not clear if bootstrapping GHC was affected. (see https://github.com/judah/haskeline/issues/20 for details)
* testsuite: add test for #10177Austin Seipp2015-03-212-0/+11
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Correct documentation in `Parser`.Matthew Pickering2015-03-211-2/+2
| | | | | | | | | Removed a trailing `in` from the final line which caused a compilation error. [skip ci] Reviewed by: thomie Differential Revision: https://phabricator.haskell.org/D744
* Update Cabal submodule to Cabal-v1.22.2.0 rls tagHerbert Valerio Riedel2015-03-211-0/+0
| | | | this submdoule updates pulls in only meta-data changes
* Update bytestring submodule to 0.10.6.0 release tagHerbert Valerio Riedel2015-03-201-0/+0
|
* Try to reconstruct a changelog for TH 2.10Herbert Valerio Riedel2015-03-201-1/+18
| | | | | | [skip ci] (cherry picked from commit 9d15af88b9b5cbf9dd4a4d072aa94540074cc4b3)
* Bump ghc-prim to 0.4.0.0Herbert Valerio Riedel2015-03-2053-122/+122
| | | | | | | | | | | | This major version bump was made necessary by f44333eae7bc7dc7b6003b75874a02445f6b633b which changed the type signatures of prefetch primops, as well as other changes such as 051d694fc978ad28ac3043d296cafddd3c2a7050 turning `Any` into an abstract closed type family. Reviewed By: ekmett Differential Revision: https://phabricator.haskell.org/D743
* Modify test th/T10019 to wobble lessSimon Peyton Jones2015-03-202-2/+9
| | | | | | | The TH output contains uniques which change too much. So I took the length of the string instead. Crude, perhaps too crude, but it'll still show up most significant output changes
* Update deepseq submodule to 1.4.1.1 tagHerbert Valerio Riedel2015-03-203-4/+4
| | | | This deepseq update drops the redundant ghc-prim dependency for GHC>=7.6
* testsuite: add a regression test for #10011Austin Seipp2015-03-194-0/+17
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Remove unused parameter to `EvTypeableTyCon`Iavor S. Diatchki2015-03-194-10/+8
|
* Merge branch 'master' of git://git.haskell.org/ghcIavor S. Diatchki2015-03-192-1/+0
|\
| * libraries: update win32 submoduleAustin Seipp2015-03-191-0/+0
| | | | | | | | | | | | This update fixes #10165. Signed-off-by: Austin Seipp <austin@well-typed.com>