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

Should we support type definitions with holes? #270

Closed
dhess opened this issue Mar 2, 2022 · 3 comments
Closed

Should we support type definitions with holes? #270

dhess opened this issue Mar 2, 2022 · 3 comments
Labels
core Core issue question This issue is a question, not a bug or feature request

Comments

@dhess
Copy link
Member

dhess commented Mar 2, 2022

This question came up in our 2022-03-01 Primer deifnition meeting: should we support type definitions with holes?

In our prototype implementation of the frontend, there was no way to construct such a thing (never mind whether the implementation supported it) — if you left anything unspecified in a typedef in the typedef UI, you could not press the "Create" button. Also, there was no way to edit the typedef once it was created.

Now that we're starting work on editable typedefs (see #267), it may be useful to allow the implementation to create holes in a typedef; e.g., as the result of an edit of typedef T which is used as a parameter in typedef S.

Besides any implementation needs, this feature might be useful from a pedagogical perspective. We obviously believe that first-class support for holes in expressions is a useful learning affordance, so why not type definitions, as well?

@dhess dhess added core Core issue question This issue is a question, not a bug or feature request labels Mar 2, 2022
@dhess dhess added this to the Primer 0.8 milestone May 9, 2023
@dhess
Copy link
Member Author

dhess commented Aug 8, 2023

I believe that in #1095, we decided not to support type definitions with holes, as they're not needed since we have *; is that correct, or is it more nuanced than that?

@georgefst
Copy link
Contributor

I believe that in #1095, we decided not to support type definitions with holes, as they're not needed since we have *

The discussion there was just about whether kind-level actions should insert holes, or skip straight to filling them with KType. We opted for the latter, but we do support such holes via the "Delete" action - they just aren't necessary.

Anyway, we now allow type-level holes to appear (in the types of constructor fields), as this is pretty crucial to the design of #949: to be able to incrementally edit types, we need holes to deal with incomplete ones.

@dhess
Copy link
Member Author

dhess commented Aug 8, 2023

Right, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core issue question This issue is a question, not a bug or feature request
Projects
None yet
Development

No branches or pull requests

2 participants