| Read the article more carefully. I wrote in multiple places that the use of newtypes does provide real safety. > If you are fond of newtypes, this whole argument may seem a bit troubling. It may seem like I’m implying newtypes are scarcely better than comments, albeit comments that happen to be meaningful to the typechecker. Fortunately, the situation is not quite that grim—newtypes can provide a sort of safety, just a weaker one. > […] > This tradeoff may not seem all that bad, and indeed, it is often a very good one! Guaranteeing invariants using constructive data modeling can, in general, be quite difficult, which often makes it impractical. > […] > Newtypes are useful when carefully applied The whole point of the blog post is that newtypes are useful, but only when used in certain ways and in a weaker sense than constructive data modeling. |
This is unnecessarily rude. Maybe you should have written the article more carefully, or read my comment more carefully.
> newtypes are useful, but only when used in certain ways and in a weaker sense than constructive data modeling
Constructive data modelling can be an easier way to provide certain kinds of guarantees in some circumstances, perhaps. But the claim that newtype-based approaches are not type safety remains false.