To expand and give some notion of good taste:
It's more about writing
struct User {phone: MaybePhoneNumber} // give or take, it's a monoid
over struct User {phone: Option<String>}To expand and give some notion of good taste:
It's more about writing
struct User {phone: MaybePhoneNumber} // give or take, it's a monoid
over struct User {phone: Option<String>}
I don't mind discussing syntax when appropriate, but this feels like arguing over which trivial brainfuck substitution[1] is the best.
> monoid
nullables with `??` and `?.` are also give-or-take monoids. is it common though to `or` two MaybePhoneNumbers together or to apply a PhoneNumber->MaybePhoneNumber function to it? if not then why mention it?
let's see something meaningfully different like a database schema.
[1] https://esolangs.org/wiki/Trivial_brainfuck_substitution