2 ms·
It's a matter of types vs representation. A compiler could represent (with or without promising to do so) optional strings as a nullable pointer to a char arra
by dllthomas 11y ago
It's a matter of types vs representation. A compiler could represent (with or without promising to do so) optional strings as a nullable pointer to a char array. Without additional help from the compiler to distinguish between Maybe String and String, then things are as you say.
Incidentally, while Maybe String can be a nullable char pointer, Maybe (Maybe String) needs a different representation. This is where "nullable" in C# breaks down compared to a real option type - but only because they conflate type and representation.