-
Notifications
You must be signed in to change notification settings - Fork 37
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
Track the kinds of scoped type variables using LocalVar
s
#613
Comments
I retract this claim, as there is one place where we rely on singletons/singletons-base/tests/compile-and-dump/Singletons/T183.hs Lines 52 to 54 in ae2a94f
When promoting the If For this reason, I'm inclined to keep |
Doing so makes it possible to track the kinds of scoped type variables with greater precision during lambda lifting. See the golden output for the new `T613` test case to see an example of this in action. Fixes #613.
Doing so makes it possible to track the kinds of scoped type variables with greater precision during lambda lifting. See the golden output for the new `T613` test case to see an example of this in action. Fixes #613.
(Originally posted in #610 (comment)).
As of #610, we use
LocalVar
s to track the kinds of promoted term-level variables, but not the kinds of scoped type variables:singletons/singletons-th/src/Data/Singletons/TH/Promote/Monad.hs
Lines 31 to 35 in a351105
Note that
pr_scoped_vars
uses a set ofName
s rather thanLocalVar
s. This means that if we were to promote something like this:Then we promote
y
, we would get something like this:This doesn't record the fact that
a :: k
, unfortunately. As such, the kind ofLetY
is more general than intended:This doesn't cause problems in any of the code in
singletons-base
, but I could easily foresee this being an issue in more sophisticated code. (See also #601.) If we usedLocalVar
s inpr_scoped_vars
, however, this would be possible.Note that if we did this, we might consider changing
pr_scoped_vars
to use a list ofLocalVar
s instead of anOSet
, as otherwise we would be sorting all of theLocalVar
s using theirDKind
'sOrd
instance, which seems wasteful. This is probably worth doing anyway, as we aren't really making essential use of the fact thatpr_scoped_vars
is anOSet
(i.e., we aren't really using that many set-like operations onpr_scoped_vars
).The text was updated successfully, but these errors were encountered: