That and in-band signalling is error-prone.
Another example that C programmers love: using 0 to mean infinity. Eg when you have a timeout setting, and 10 means ten seconds, but 0 means infinity seconds instead of zero seconds.
Another example that C programmers love: using 0 to mean infinity. Eg when you have a timeout setting, and 10 means ten seconds, but 0 means infinity seconds instead of zero seconds.
In Haskell, the closest thing to adding 5 to an optional value would be something like:
fmap (5+) my_optional_value
This one leaves 'Nothing' alone, but adds 5 in case the value is present.What Rust calls an enum, but an enum with payloads. In C terms it would be a discriminated union.