|
|
|
|
|
by Hackbraten
576 days ago
|
|
Maybe I'm spoiled by TypeScript but this is how I'd do it in a structural typing system: type ConstrainedByW =
| { w: false, x: false }
| { w: true, x: bool }
type ConstrainedByY =
| { x: bool, y: false, z: bool }
| { x: true, y: true, z: false }
type ProgramState = ConstrainedByW & ConstrainedByY
|
|