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 /testsuite/tests/ghci/scripts/T10059.stdout | |
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 'testsuite/tests/ghci/scripts/T10059.stdout')
-rw-r--r-- | testsuite/tests/ghci/scripts/T10059.stdout | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/testsuite/tests/ghci/scripts/T10059.stdout b/testsuite/tests/ghci/scripts/T10059.stdout index 26e1e7e28f..92fbb45ef7 100644 --- a/testsuite/tests/ghci/scripts/T10059.stdout +++ b/testsuite/tests/ghci/scripts/T10059.stdout @@ -1,9 +1,4 @@ -class (a ~ b) => (~) (a :: k) (b :: k) - -- Defined in ‘Data.Type.Equality’ -instance [incoherent] forall k (a :: k) (b :: k). (a ~ b) => a ~ b - -- Defined in ‘Data.Type.Equality’ -(~) :: k -> k -> Constraint -class (a ~~ b) => (~) (a :: k) (b :: k) - -- Defined in ‘Data.Type.Equality’ -instance [incoherent] forall k (a :: k) (b :: k). (a ~~ b) => a ~ b - -- Defined in ‘Data.Type.Equality’ +class (a ~ b) => (~) (a :: k0) (b :: k0) -- Defined in ‘GHC.Types’ +(~) :: k0 -> k0 -> Constraint +class (a GHC.Prim.~# b) => (~) (a :: k0) (b :: k0) + -- Defined in ‘GHC.Types’ |