This example creates a monad parametized over how many times a return value must be consumed. It has two settings: 1 (exactly once), and ω, which I’m prettying sure is the Greek abbreviation of “whatever” (zero or more times).
This example creates a monad parametized over how many times a return value must be consumed. It has two settings: 1 (exactly once), and ω, which I’m prettying sure is the Greek abbreviation of “whatever” (zero or more times).
As far as I can tell this isn't relevant to the pattern being discussed though. All that matters is that a type can be consumed at most once, which is a capability provided by both linear and affine types. If you're worried about guaranteeing that the state machine ends gracefully (in this case, the socket being closed), then that's the role that destructors play. Indeed, the fact that destructors exist is what initially gives the impression of Rust having a linear type system; the only time that Rust doesn't guarantee exactly-once behavior (degenerating to at-most-once) is when the destructor leaks, which is pretty hard to do by accident (e.g. creating cyclical references in Rust is non-trivial).
edit: ah I see you'd extract the entire manipulation in a function which would return a terminal type or union thereof, yeah that'd work I guess.
Or it is the classical notation for the ordinal associated with the set of integers ℕ, aka any number of times.