News for hackers. Stuff that matters.
Re:Typed nils in Go 2 by zupa-hu on Friday August 11, 2017 @02:30AM (#14987111)
You use the default empty value, and have an extra field for missingness. Than you have real type safety.
Re:Typed nils in Go 2 by TheDong on Friday August 11, 2017 @03:11AM (#14987300)
Real type safety is sum types. If I need to express something that is present or missing, I should use a Maybe monad.

Having an extra field for "missingness" is less safe because the type system won't enforce that it is either missing or set, you could have it set to a value but marked as missing which is still ambiguous.

Re:Typed nils in Go 2 by sorkin2 on Friday August 11, 2017 @06:21AM (#14988151)
That's a "cure" worse than the disease.