3 ms·
> The primary point of branded types is to allow you to use the type system to ensure that a particular runtime check has taken place. I see. This is kind of c
by dvt 2y ago
> The primary point of branded types is to allow you to use the type system to ensure that a particular runtime check has taken place.
I see. This is kind of cool, though the branding can still be broken via down-the-stream mutations. Would be nice to enforce re-branding every time a variable is changed, but that seems like a lot of overhead.
- tshaddox 2y ago> the branding can still be broken via down-the-stream mutations Only for mutable values! A branded string should be as immutable as they come, right?