what’s a better name for the “TypeThatCanEncodeState” protocol? ExpressibleByState, LosslessStateConvertible, StateStorage, etc. just don’t feel right.
“StateEncoder” makes more sense semantically, but i don’t want to give the impression that the protocol has anything to do with Encoder or Encodable.
Maybe ConstructibleFromState? Though would this be that much more useful than say, abstracting over the constructed type T and then taking a (State) -> T function wherever you’d want to accept this protocol?
The semantics of the protocol seem a bit underspecified to be particularly useful.
Yeah, point taken. This does feel like a bag-of-syntax protocol, but sometimes those can let you do some nice boilerplate reduction. Though without clear semantics, naming is definitely more difficult.
i’ve come to recognize that 95% of time spent writing HTML rendering code is time spent on boilerplate reduction. but the boilerplate reduction just requires more boilerplate elsewhere…