differential-datalog icon indicating copy to clipboard operation
differential-datalog copied to clipboard

[Feature Request] Tuple variants & structs

Open Kixiron opened this issue 4 years ago • 2 comments

Tuple enum variants and tuple structs would be nice for scenarios where the inner type doesn't need an extra description, such as

typedef Id = Id(usize)

typedef IdKind = FirstId(usize) | SecondId(usize)

Kixiron avatar Dec 14 '20 20:12 Kixiron

The proposal makes sense and will certainly improve the ergonomics in certain cases. A proper implementation will involve significant extensions throughout the compiler. Alternatively, we can implement this as syntactic sugar on top of normal structs and enums. However, I am reluctant to add non-critical features to the language at the moment, so can't promise this will happen soon.

ryzhyk avatar Dec 14 '20 21:12 ryzhyk

That's perfectly fine, I just wanted to make an issue for posterity's sake

Kixiron avatar Dec 14 '20 21:12 Kixiron