c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Rename `inner_kind` and `inner_type`.

Open cbuttner opened this issue 1 year ago • 5 comments

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.

cbuttner avatar Sep 03 '24 09:09 cbuttner

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

lerno avatar Sep 05 '24 21:09 lerno

Any thoughts?

lerno avatar Sep 07 '24 14:09 lerno

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?

lerno avatar Oct 03 '24 20:10 lerno

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.

cbuttner avatar Oct 10 '24 14:10 cbuttner

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

lerno avatar Oct 12 '24 00:10 lerno

distinct_of?

lerno avatar Oct 31 '24 10:10 lerno

distinctof to be consistent.

sa-tasche avatar Dec 06 '24 17:12 sa-tasche

@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.

lerno avatar Dec 06 '24 20:12 lerno

I'm going to close this because I don't think there is a better name for now. Let's revisit this later when the compiler have gone through further refactorings.

lerno avatar Jan 10 '25 12:01 lerno