|
|
|
|
|
by ddevault
1510 days ago
|
|
I'm not sure what you mean by "select by type". I can say that you can define new types: type a = int;
type b = int;
type c = (a | b);
Which seems to be what you're angling for here? I also suspect that you're approaching this from a Rust- or Zig-like background where enums and tagged unions are closely related; this is not so in Hare. |
|
The example you linked did not really make it clear from my point of view because one of the points is that it will collapse if there are multiples of a specific type. But your way seems to make it possible.