Syntax sugar for record with same type name #2872
0komo
started this conversation in
Ideas & suggestions
Replies: 2 comments 5 replies
-
Could be good! Though as you've pointed out that syntax is already in use for type parameters. We'd need to use some other syntax. |
Beta Was this translation helpful? Give feedback.
5 replies
-
This hides the difference between type and constructor/variant and makes things harder to grasp. Things like say use (or optional args provide) benefits at the call site, this provides only benefits at the definition site and personally I prefer the clarity instead, here. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes writing a record with same name for the type is unconvenient, especially if it's repetitive. For example
Instead of writing repetitive
type A { A(B) }
, we can just havetype A(B)
.There's might be a better form for this syntax, since it's ambiguous for generic syntax.
Beta Was this translation helpful? Give feedback.
All reactions