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

Field names for value constructors #1108

Open
dhess opened this issue Aug 9, 2023 · 2 comments
Open

Field names for value constructors #1108

dhess opened this issue Aug 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dhess
Copy link
Member

dhess commented Aug 9, 2023

We would like support for (probably optional) value constructor field/parameter names. The main benefit of this feature in Primer would be for descriptive, helpful parameter names when pattern-matching against such constructors.

@dhess dhess added this to the Primer (language) 0.8 milestone Aug 9, 2023
@dhess dhess added the enhancement New feature or request label Aug 16, 2023
@georgefst
Copy link
Contributor

When we do this, we'll want to add a Maybe Field field to the ConField flavor (added in #1176). Note that this will considerably change EdgeFlavors OpenAPI/JSON instances, since the type will no longer be an enum.

@georgefst
Copy link
Contributor

The main benefit of this feature in Primer would be for descriptive, helpful parameter names when pattern-matching against such constructors.

This would certainly be useful, but the main benefit as far as I'm concerned would be being able to have labels in a UI describing which field is which, both when constructing and deconstructing. Consider for example the use of colours in #1173. The fact that we have no indication of which child is "red", "green" or "blue" seriously impacts the readability of programs.

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

2 participants