|
|
|
|
|
by pdhborges
1350 days ago
|
|
This code example doesn't make much sense. There is already a type to represent a valid email address (EmailAddress), why are we creating a function to make contacts that receives an email as a string. Just change the function to receive EmailAddress in the first place and avoid all the matching mess. |
|
You can /always/ go from `f : t -> r` to `f' : t option -> r option` with `Option.map` (ML-syntax, translate to w/e type syntax you're most familiar with), but the reverse is not true.
I think that the example is super-simplified though and I think that the central point still stands if you have multiple errors though.