@@ -23,6 +23,7 @@ import GHC.SourceGen.Binds
23
23
import GHC.SourceGen.Expr
24
24
import GHC.SourceGen.Overloaded
25
25
import GHC.SourceGen.Pat
26
+ import Ide.Plugin.Tactic.GHC
26
27
import Ide.Plugin.Tactic.Judgements
27
28
import Ide.Plugin.Tactic.Machinery
28
29
import Ide.Plugin.Tactic.Naming
@@ -120,13 +121,13 @@ unzipTrace l =
120
121
121
122
122
123
-- | Essentially same as 'dataConInstOrigArgTys' in GHC,
123
- -- but we need some tweaks in GHC >= 8.8.
124
- -- Since old 'dataConInstArgTys' seems working with >= 8.8,
125
- -- we just filter out class dictionaries and coercions from the result.
124
+ -- but only accepts universally quantified types as the second arguments
125
+ -- and automatically introduces existentials.
126
126
dataConInstOrigArgTys' :: DataCon -> [Type ] -> [Type ]
127
- dataConInstOrigArgTys' con ty =
128
- let tys0 = dataConInstOrigArgTys con ty
129
- in filter (not . isPredTy) tys0
127
+ dataConInstOrigArgTys' con uniTys =
128
+ let exvars = dataConExTys con
129
+ in dataConInstOrigArgTys con $
130
+ uniTys ++ map mkTyVarTy exvars
130
131
131
132
------------------------------------------------------------------------------
132
133
-- | Combinator for performing case splitting, and running sub-rules on the
0 commit comments