2 ms·
I think the article mixes up "type" and "newtype". "newtype Email = String" doesn't make sense.
by wyager 11y ago
I think the article mixes up "type" and "newtype". "newtype Email = String" doesn't make sense.
- gizmo686 11y ago"type" wouldn't work in this context, as it is literally just an alias, so the compiler cannot use to determine what instance to use. In contrast, newtype actually creates a new type, that acts as a wrapper around the old type. I believe what the author meant to say was "newtype Email = Email String".