| ... |
... |
@@ -17,9 +17,9 @@ import GHC.Driver.Config.Core.Rules ( initRuleOpts ) |
|
17
|
17
|
import GHC.Core.Type hiding( substTy, substCo, extendTvSubst, zapSubst )
|
|
18
|
18
|
import GHC.Core.SimpleOpt( defaultSimpleOpts, simpleOptExprWith, exprIsConApp_maybe )
|
|
19
|
19
|
import GHC.Core.Predicate
|
|
20
|
|
--- import GHC.Core.Class( classMethods )
|
|
|
20
|
+import GHC.Core.Class( classMethods )
|
|
21
|
21
|
import GHC.Core.Coercion( Coercion )
|
|
22
|
|
--- import GHC.Core.DataCon (dataConTyCon)
|
|
|
22
|
+import GHC.Core.DataCon (dataConTyCon)
|
|
23
|
23
|
|
|
24
|
24
|
import qualified GHC.Core.Subst as Core
|
|
25
|
25
|
import GHC.Core.Unfold.Make
|
| ... |
... |
@@ -28,7 +28,7 @@ import GHC.Core.Make ( mkLitRubbish ) |
|
28
|
28
|
import GHC.Core.Unify ( tcMatchTy )
|
|
29
|
29
|
import GHC.Core.Rules
|
|
30
|
30
|
import GHC.Core.Subst (substTickish)
|
|
31
|
|
--- import GHC.Core.TyCon (tyConClass_maybe)
|
|
|
31
|
+import GHC.Core.TyCon (tyConClass_maybe)
|
|
32
|
32
|
import GHC.Core.Utils ( exprIsTrivial, exprIsTopLevelBindable
|
|
33
|
33
|
, mkCast, exprType, exprIsHNF
|
|
34
|
34
|
, stripTicksTop, mkInScopeSetBndrs )
|
| ... |
... |
@@ -3128,13 +3128,12 @@ interestingDict env arg -- Main Plan: use exprIsConApp_maybe |
|
3128
|
3128
|
| otherwise
|
|
3129
|
3129
|
-> exprIsHNF arg -- See (ID7)
|
|
3130
|
3130
|
|
|
3131
|
|
- | Just (_, _, _data_con, _tys, _args) <- exprIsConApp_maybe in_scope_env arg
|
|
3132
|
|
--- , Just cls <- tyConClass_maybe (dataConTyCon data_con)
|
|
|
3131
|
+ | Just (_, _, data_con, _tys, args) <- exprIsConApp_maybe in_scope_env arg
|
|
|
3132
|
+ , Just cls <- tyConClass_maybe (dataConTyCon data_con)
|
|
3133
|
3133
|
, definitely_not_ip_like -- See (ID4)
|
|
3134
|
|
- = True
|
|
3135
|
|
--- = if null (classMethods cls) -- See (ID6)
|
|
3136
|
|
--- then any (interestingDict env) args
|
|
3137
|
|
--- else True
|
|
|
3134
|
+ = if null (classMethods cls) -- See (ID6)
|
|
|
3135
|
+ then any (interestingDict env) args
|
|
|
3136
|
+ else True
|
|
3138
|
3137
|
|
|
3139
|
3138
|
| otherwise
|
|
3140
|
3139
|
= not (exprIsTrivial arg) && definitely_not_ip_like -- See (ID8)
|