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

Duplicate typedef action #1141

Open
georgefst opened this issue Sep 12, 2023 · 1 comment
Open

Duplicate typedef action #1141

georgefst opened this issue Sep 12, 2023 · 1 comment
Labels
enhancement New feature or request triage This issue needs triage

Comments

@georgefst
Copy link
Contributor

Description

This is a feature request.

We have a "duplicate this definition" action available on all term definitions. We ought to have the same for type definitions.

Spec

When performed on a type T with constructors A and B, this action would create a new type TCopy with constructors ACopy and BCopy. All parameters and fields would be as in T.

Implementation details

Note that DuplicateDef's implementation (in toProgActionNoInput) relies on CopyPasteSig and CopyPasteBody. We don't yet have equivalents CopyPasteConField and CopyPasteParamKind. The bulk of the work in implementing this whole spec would be adding these low-level copy actions. Note that copying of kinds is something which we'll also need for implementing "raise kind".

@georgefst georgefst added enhancement New feature or request triage This issue needs triage labels Sep 12, 2023
@georgefst
Copy link
Contributor Author

georgefst commented Sep 12, 2023

When performed on a type T with constructors A and B, this action would create a new type TCopy with constructors ACopy and BCopy. All parameters and fields would be as in T.

I'm using the same naming system here that we currently have for terms. I actually think T (copy) etc. would be more pleasant. Of course, if we do choose a different naming system we should modify DuplicateDef to use the same one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage This issue needs triage
Projects
None yet
Development

No branches or pull requests

1 participant