Remove wrinkle 2 (and revise wrinkle 3) of Note [Preserve the order of type variables during singling]
#616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that goldfirere/th-desugar#199 has been fixed,
singletons-th
can always guarantee that the type variable specificities that it reifies will be accurate. As such, all of wrinkle 2 inNote [Preserve the order of type variables during singling]
is moot, so this PR deletes this wrinkle entirely. Wrinkle 3 has now been renamed to wrinkle 2.What was formerly known as wrinkle 3 is mostly kept the same, although I have expanded upon it a little to clarify what we single data constructors such as
Nothing :: forall a. Maybe a
toSNothing :: forall a. SMaybe (Nothing :: Maybe a)
rather than, say,SNothing :: forall a. SMaybe (Nothing @a)
. For instance, imagine ifa
was inferred rather than specified!I have added a
T565
test case which ensures thatsingletons-th
generates valid code for the case when a data constructor uses an inferred type variable binder. I have also added an addendum to theREADME
noting thatsingletons-th
does not currently supportAllowAmbiguousTypes
at all, which would be perhaps the one convincing argument in favor of using explicit kind applications when singling return types (rather than explicit return kinds).Fixes #565.