3 ms·
> Sometimes I get really confused why signed shows up in places it doesn’t belong. Because in the absence of convenient sum types, you end up using a simple ty
by dragonwriter 7y ago
> Sometimes I get really confused why signed shows up in places it doesn’t belong.
Because in the absence of convenient sum types, you end up using a simple type with sentinel/special values so often that anything where the main value is logically non-negative (or strictly positive) but you don't have a clear reason to never need special values is done with a signed type where negative (and possibly zero) values are reserved or assigned to special uses.