6 ms·
Sum type is key, called "discriminated union" sometimes generally. In Rust this is an `enum`. Simulated in some languages as tuples with tag first element. Disc
by alwaysbeconsing 2y ago
Sum type is key, called "discriminated union" sometimes generally. In Rust this is an `enum`. Simulated in some languages as tuples with tag first element. Discrete number of states, attaching information only relevant to each single state. Thus, never have invalid combination of other fields.
- mrkeen 2y agoI think in this context 'state' means 'state which changes over time', not necessarily the shape of the state at rest. Turning it off and on again will fix mutable state, not poorly-typed state.