16 ms·
Could there be a way to eliminate the problem of null values floating through your system? Maybe.
by yakshaving_jgt 5y ago
Could there be a way to eliminate the problem of null values floating through your system?
Maybe.
- happytoexplain 5y agoI see what you did there. And Swift, the very language the author is comparing to, has this functionality.
- deltaonefour 5y agoSo does Haskell and Rust. It's called exhaustive pattern matching on sum types with the Maybe monad (or Optional). I believe Haskell popularized this syntax and Rust and Swift borrowed it from Haskell. Strictly speaking though, haskell pattern matching isn't exhaustive but the compiler will give you a warning if your code doesn't handle every case. Elm is another language that exploits this feature to a scale where unless you use the FFI, elm programs cannot logically ever crash.