diff options
author | nineonine <mail4chemik@gmail.com> | 2021-11-10 00:52:06 -0800 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-20 21:16:06 -0400 |
commit | c842611fc72d987519cd9fab1c351135ae93665e (patch) | |
tree | aa4365b4050a0733887a4d4f0291e6e9d52cc801 /testsuite/tests/deriving/should_fail | |
parent | d45bb70178e044bc8b6e8215da7bc8ed0c95f2cb (diff) | |
download | haskell-c842611fc72d987519cd9fab1c351135ae93665e.tar.gz |
Revamp derived Eq instance code generation (#17240)
This patch improves code generation for derived Eq instances.
The idea is to use 'dataToTag' to evaluate both arguments.
This allows to 'short-circuit' when tags do not match.
Unfortunately, inner evals are still present when we branch
on tags. This is due to the way 'dataToTag#' primop
evaluates its argument in the code generator. #21207 was
created to explore further optimizations.
Metric Decrease:
LargeRecord
Diffstat (limited to 'testsuite/tests/deriving/should_fail')
-rw-r--r-- | testsuite/tests/deriving/should_fail/drvfail011.stderr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/deriving/should_fail/drvfail011.stderr b/testsuite/tests/deriving/should_fail/drvfail011.stderr index d439bd03eb..5b26f5b575 100644 --- a/testsuite/tests/deriving/should_fail/drvfail011.stderr +++ b/testsuite/tests/deriving/should_fail/drvfail011.stderr @@ -3,8 +3,8 @@ drvfail011.hs:8:1: error: • No instance for (Eq a) arising from a use of ‘==’ Possible fix: add (Eq a) to the context of the instance declaration • In the expression: a1 == b1 - In an equation for ‘==’: (==) (T1 a1) (T1 b1) = ((a1 == b1)) + In a case alternative: (T1 b1) -> ((a1 == b1)) + In the expression: case b of (T1 b1) -> ((a1 == b1)) When typechecking the code for ‘==’ in a derived instance for ‘Eq (T a)’: To see the code I am typechecking, use -ddump-deriv - In the instance declaration for ‘Eq (T a)’ |