3 ms·
Neither the function names or whether a type systems has null or not depends on the paradigm (functional/OO/imperative/procedural/whatever). I prefer type syst
by alkonaut 10y ago
Neither the function names or whether a type systems has null or not depends on the paradigm (functional/OO/imperative/procedural/whatever).
I prefer type systems without null if given the choice, but for composition there isn't much different between result|error and result|null (If the null/error case is actually handled. Unless you use C you can usually handle it with something that resembles modads or is at least a pattern matching shorthand
C#
var managerStreet = employee.Manager?.Address?.Street;
Which is very similar looking to how Rust (Which has no null) propagates errors:
foo()?.bar()?.baz()?
- kazagistar 10y agoAfaik using `?` for `Option` is part of the `Carrier` trait which is unstable and only in nightly Rust for the time being.