Remove wrinkle 2 (and revise wrinkle 3) of Note [Preserve the order of type variables during singling]#616
Merged
RyanGlScott merged 1 commit intomasterfrom Jul 23, 2024
Merged
Conversation
…f type variables during singling] 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 in `Note [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` to `SNothing :: forall a. SMaybe (Nothing :: Maybe a)` rather than, say, `SNothing :: forall a. SMaybe (Nothing @A)`. For instance, imagine if `a` was inferred rather than specified! I have added a `T565` test case which ensures that `singletons-th` generates valid code for the case when a data constructor uses an inferred type variable binder. I have also added an addendum to the `README` noting that `singletons-th` does not currently support `AllowAmbiguousTypes` 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-thcan 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 atoSNothing :: forall a. SMaybe (Nothing :: Maybe a)rather than, say,SNothing :: forall a. SMaybe (Nothing @a). For instance, imagine ifawas inferred rather than specified!I have added a
T565test case which ensures thatsingletons-thgenerates valid code for the case when a data constructor uses an inferred type variable binder. I have also added an addendum to theREADMEnoting thatsingletons-thdoes not currently supportAllowAmbiguousTypesat 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.