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

type-literals for the later phase #244

Open
gelisam opened this issue Jun 25, 2024 · 0 comments
Open

type-literals for the later phase #244

gelisam opened this issue Jun 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@gelisam
Copy link
Owner

gelisam commented Jun 25, 2024

A value of type Type is a type in the later phase (typically a macro executes at phase 1 and manipulates terms and types from phase 0). We can write (the (Maybe Integer) (just 42)) to construct a value of type (Maybe Integer), but we can't write (the Type (Maybe Integer)) to construct a value of type Type, because the Maybe macro is only valid in the type and type-pattern contexts, it is not valid in the expression context.

I propose a macro the-type which can be used this way:

(type-case (the-type (Maybe Integer))
  ...)

The macro the-type would expand (Maybe Integer) in the type context in the later phase (in this example (type-case ...) and (the-type ...) are executing at phase 1, and (Maybe Integer) would be expanded at phase 0).

@gelisam gelisam added the enhancement New feature or request label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant