Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fumiaki Kinoshita
GHC
Commits
bfe7766a
Commit
bfe7766a
authored
Oct 12, 2021
by
Fumiaki Kinoshita
💬
Browse files
attempt to bind a type parameter for Rep1
parent
96fa2292
Changes
1
Show whitespace changes
Inline
Side-by-side
compiler/GHC/Tc/Deriv/Generics.hs
View file @
bfe7766a
...
@@ -444,14 +444,15 @@ tc_mkRepFamInsts gk tycon inst_tys =
...
@@ -444,14 +444,15 @@ tc_mkRepFamInsts gk tycon inst_tys =
-- type arguments before generating the Rep/Rep1 instance, since some
-- type arguments before generating the Rep/Rep1 instance, since some
-- of the tyvars might have been instantiated when deriving.
-- of the tyvars might have been instantiated when deriving.
-- See Note [Generating a correctly typed Rep instance].
-- See Note [Generating a correctly typed Rep instance].
;
let
(
env_tyvars
,
env_inst_args
)
;
let
(
rep1_args
,
env_tyvars
,
env_inst_args
)
=
case
gk_
of
=
case
gk_
of
Gen0_
->
(
tyvars
,
inst_args
)
Gen0_
->
(
[]
,
tyvars
,
inst_args
)
Gen1_
last_tv
Gen1_
last_tv
-- See the "wrinkle" in
-- See the "wrinkle" in
-- Note [Generating a correctly typed Rep instance]
-- Note [Generating a correctly typed Rep instance]
->
(
last_tv
:
tyvars
->
(
[
last_tv
]
,
anyTypeOfKind
(
tyVarKind
last_tv
)
:
inst_args
)
,
last_tv
:
tyvars
,
mkTyVarTy
last_tv
:
inst_args
)
env
=
zipTyEnv
env_tyvars
env_inst_args
env
=
zipTyEnv
env_tyvars
env_inst_args
in_scope
=
mkInScopeSet
(
tyCoVarsOfTypes
inst_tys
)
in_scope
=
mkInScopeSet
(
tyCoVarsOfTypes
inst_tys
)
subst
=
mkTvSubst
in_scope
env
subst
=
mkTvSubst
in_scope
env
...
@@ -461,7 +462,7 @@ tc_mkRepFamInsts gk tycon inst_tys =
...
@@ -461,7 +462,7 @@ tc_mkRepFamInsts gk tycon inst_tys =
tvs'
=
scopedSort
tv'
tvs'
=
scopedSort
tv'
cvs'
=
scopedSort
cv'
cvs'
=
scopedSort
cv'
axiom
=
mkSingleCoAxiom
Nominal
rep_name
tvs'
[]
cvs'
axiom
=
mkSingleCoAxiom
Nominal
rep_name
tvs'
[]
cvs'
fam_tc
inst_tys
repTy'
fam_tc
(
map
mkTyVarTy
rep1_args
++
inst_tys
)
repTy'
;
newFamInst
SynFamilyInst
axiom
}
;
newFamInst
SynFamilyInst
axiom
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment