Commit

974d44c

sum types: delete the impossible combinations pain: a struct with optional fields allows nonsense.
rust
struct Conn {
    socket: Option<Socket>,
    retry:  Option<u8>,
    error:  Option<String>,
}
that gives 2 × 2 × 2 = 8 shapes, and only 3 of them mean anything. => list only the real cases:
rust
enum Conn {
    Retrying(u8),
    Open(Socket),
    Failed(String),
}
origin: the Hope and ML languages, late 1970s. Yaron Minsky later gave the goal its slogan: "make illegal states unrepresentable".

commit 974d44c