Comment

Comment by ethangk

This reminds me of the Make Illegal States Unrepresentable[0] idea, where something will return a ‘ResolvedExecutor’ type to guarantee that you’re only working with something in the state you want. Go makes this a little clunky to do, though. I suppose you could use Generics to implement a Preresolved and Resolved struct.

[0] https://fsharpforfunandprofit.com/posts/designing-with-types...

parent ethangk 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton