Re:Names are not type safety
by shawnz on Sunday November 01, 2020 @09:40PM
(#24964411)
The article gives some examples why smart constructors don't fully solve the problem in the section "Newtypes as tokens"
[ Parent
| on HN ]
Re:Names are not type safety
by alexmingoia on Sunday November 01, 2020 @09:45PM
(#24964421)
Yeah, I don’t find those points very convincing. Obviously if you export other ways to construct the type, it doesn’t work...
It’s like saying “if you forget to sanitize input it won’t get sanitized.” Okay?
Re:Names are not type safety
by imoverclocked on Sunday November 01, 2020 @10:04PM
(#24964484)
The entire point of a good type system is to reduce the need for extra cognitive diligence around your data/code. The more corner cases you have to be careful around, the less helpful the type system is.