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

Rename inner_kind and inner_type. #1405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cbuttner
Copy link
Contributor

@cbuttner cbuttner commented Sep 3, 2024

Rename to remove_distinct_kind and remove_distinct.

Are these names good? It might not be obvious they remove distinct recursively.
The alternative contenders would be flatten_kind and flatten, but then it's not entirely obvious what it does either.

@lerno
Copy link
Collaborator

lerno commented Sep 5, 2024

I'm thinking "base" might be better - talking about the "base type" of something.

@lerno
Copy link
Collaborator

lerno commented Sep 7, 2024

Any thoughts?

@lerno
Copy link
Collaborator

lerno commented Oct 3, 2024

In the compiler, removing the distinct-ness is known as flattening, whereas reducing types to their backend representations is known as lowering (and should only be done in the backend), maybe this can be used if it is only distinct?

@cbuttner
Copy link
Contributor Author

base_type is not bad but it's also not super clear, just from the name alone one might think it returns the underlying type of an enum or optional, or it could resolve subtyped structs with inline to it's "base type".
I think it's a similar problem with flatten or lower.
I personally like remove_distinct for it's clarity but I'm open to whatever.

@lerno
Copy link
Collaborator

lerno commented Oct 12, 2024

flatten and lower does have the advantage of being well defined within the compiler.

@lerno
Copy link
Collaborator

lerno commented Oct 31, 2024

distinct_of?

@sa-tasche
Copy link

distinctof to be consistent.

@lerno
Copy link
Collaborator

lerno commented Dec 6, 2024

@sa-tasche That seems to be a bit reverse of what is meant though? It's getting the type the distinct is using as a based.

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

Successfully merging this pull request may close these issues.

3 participants