diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2018-07-27 09:01:46 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2018-07-27 09:16:11 +0100 |
commit | f265008fb6f70830e7e92ce563f6d83833cef071 (patch) | |
tree | 08b37ad197099b9d614386ea92416450038956ea /compiler/main | |
parent | 4c571f3321eb8f7a06dada4c37822c22bbdd148b (diff) | |
download | haskell-f265008fb6f70830e7e92ce563f6d83833cef071.tar.gz |
Refactor (~) to reduce the suerpclass stack
The constraint (~) used to be (effectively):
class a ~~ b => (a :: k) ~ (b :: k)
but, with this patch, it is now defined uniformly with
(~~) and Coercible like this:
class a ~# b => (a :: k) ~ (b :: k)
Result:
* One less superclass selection when goinng from (~) to (~#)
Better for compile time and better for debugging with -ddump-simpl
* The code for (~), (~~), and Coercible looks uniform, and appears
together, e.g. in TysWiredIn and ClsInst.matchGlobalInst.
Previously the code for (~) was different, and unique.
Not only is this simpler, but it also makes the compiler a bit faster;
T12227: 9% less allocation
T12545: 7% less allocation
This patch fixes Trac #15421
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/HscTypes.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 0c375f074c..27c699c190 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -174,8 +174,7 @@ import CoAxiom import ConLike import DataCon import PatSyn -import PrelNames ( gHC_PRIM, ioTyConName, printName, mkInteractiveModule - , eqTyConName ) +import PrelNames ( gHC_PRIM, ioTyConName, printName, mkInteractiveModule ) import TysWiredIn import Packages hiding ( Version(..) ) import CmdLineParser |