Idea: reducing boilerplate in APIs that use ADTs

I like. _ in type context already means “please infer this”, so using it for struct literals makes sense. FRU is a documentation example for Default, and I can’t imagine any other no-parameter thing that would make sense. Plus the symmetry with pattern syntax is nice. (I also think that it’s cool that pseudo-code already tends to look like { a: 4, .. }, and now it’d compile :laughing:)

Here are some more places where the same or similar things have come up:

Maybe it just needs someone to write an RFC? (Or maybe three, since they’re separable.)

2 Likes