top | item 39808837

(no title)

alwaysbeconsing | 1 year 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.

discuss

order

mrkeen|1 year ago

I 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.