Skip to content
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

Some Types are not fully expanded #133

Open
wilbowma opened this issue Jun 23, 2020 · 2 comments
Open

Some Types are not fully expanded #133

wilbowma opened this issue Jun 23, 2020 · 2 comments

Comments

@wilbowma
Copy link
Owner

wilbowma commented Jun 23, 2020

It looks like some types, namely universes (surprise surprise) are not fully expanded when they are matched against their pattern expanders. I'm guessing this happens because universes store their types unexpanded since they need to be expanded lazily. Unfortunately, the pattern expanded for universes doesn't first expand the type.

This causes a problem if anyone tries to extend universes, creating a type that expands to a universe, as I just did.

(define-typed-syntax Type
  [(_ s:layer n:nat) Γë½
   #:with n+1 (+ (syntax-e #'n) 1)
   ---------------------
   [≻ #,(syntax-property
         (syntax-property (cur-expand #'(Type- n)) 'layer (syntax->datum #'s))
         ':
         #'(Type s n+1))]])

I have a fix, but I think the root cause is that we need better Turnstile abstractions for universes.

@stchang

wilbowma added a commit that referenced this issue Jun 23, 2020
@stchang
Copy link
Collaborator

stchang commented Jun 23, 2020

Yes this is a known problem.

If you look at current-typecheck-relation it has to check for both unexpanded and unexpanded Type too. So your hack is reasonable. Not sure how to handle it with the current Racket macro system.

@stchang
Copy link
Collaborator

stchang commented Jul 2, 2020

solving #90 (or #37) would also help with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants