When promoting a class with a standalone kind signature, it is possible to ensure that the promoted methods' kind variables are quantified in the same order as the original method's type variables. This is now possible thanks to the TypeAbstractions language extension, which lets singletons-th pick the exact order of kind variables in the promoted methods' associated type families using @ binders. For the full details of how this is accomplished, see the expanded Note [Promoted class methods and kind variable ordering] in D.S.TH.Promote (specifically, Case 1: Parent class with standalone kind signature).
As it turns out, many of the steps we need to perform to achieve this are the same steps that the singDataSAK function performs when producing a standalone kind signature for a singled data declaration. As such, I factored out the common bits into a helper function called matchUpSAKWithDecl in D.S.TH.Util.
When promoting a class with a standalone kind signature, it is possible to ensure that the promoted methods' kind variables are quantified in the same order as the original method's type variables. This is now possible thanks to the
TypeAbstractions
language extension, which letssingletons-th
pick the exact order of kind variables in the promoted methods' associated type families using@
binders. For the full details of how this is accomplished, see the expandedNote [Promoted class methods and kind variable ordering]
inD.S.TH.Promote
(specifically,Case 1: Parent class with standalone kind signature
).As it turns out, many of the steps we need to perform to achieve this are the same steps that the
singDataSAK
function performs when producing a standalone kind signature for a singleddata
declaration. As such, I factored out the common bits into a helper function calledmatchUpSAKWithDecl
inD.S.TH.Util
.Fixes https://github.com/goldfirere/singletons/issues/589.