Are there programming languages that allow you to do set arithmetic on types?
- by Will Brown
Out of curiosity, are there languages that allow you to do set arithmetic on types to create new types? Something like:
interface A {
void a();
void b();
}
interface B {
void b();
void c();
}
interface C = A & B; // has b()
interface D = A | B; // has a(), b() and c()
interface E = (A & B) ^ B; // has c()
I know that in some…