-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support partial type synonyms #4
Comments
Maybe I misunderstood this comment. Actually they are okay with elaboration: atleast in GHC-9.
We also perform some optimization where if |
consider the following declarations data Ord a => T a = ...
type T a = DT a
f :: ... -> T a -> ... we elaborate the type signature of f :: DT @ a => ... -> T a -> ... I don't think we need to generate a special |
Inlining terms with type synonyms are no longer are an issue. I suspect this was an issue when we had disabled type reduction. |
Marking this as low priority as not having constraint type synonyms is not going to break our work. |
While we're thinking about #3, we should be sure that type synonyms don't give another route to an ill-kinded type. Something like:
There's also a historical detail here: the first version of the Haskell report allowed you to write
but this was dropped from later versions of the report, as nobody knew how to implement it.
There's a similar approach to that for type families:
Type synonym declarationstype T a = U
should also generate declarationstype X_T a = wft(U)
T a
should be constrained byX_T a
.Inlining terms that have type as type synonyms sometimes fails. (ref. in Cabal,#~
unfolding in functionliftOptionL
)The GHC parser doesn't seem to include support for constraints on type synonym declarations, so I don't think actually supporting them is a top priority.
The text was updated successfully, but these errors were encountered: