3 ms·
> Option/Maybe is enforced by the compiler on most languages that have it. It's enforced by exactly zero languages. It's up to the developer to decide that th
by hota_mazi 6y ago
> Option/Maybe is enforced by the compiler on most languages that have it.
It's enforced by exactly zero languages.
It's up to the developer to decide that their function should return an Option/Maybe instead of the naked value.
By definition, any library construct is NOT enforced by the compiler, because... well, it's a library construct and not a language construct.
- dragonwriter 6y ago> It's enforced by exactly zero languages. It's enforced in exactly the same way a nullability constraint is; if you don't use Maybe[T] instead of T , you can't use None (presuming T itself isn't Maybe[U]), just as if you don't use a nullable type you can't use null.