3 ms·
C# and Java optionals aren't very useful, since they would be reference types themselves, and thus could be null! I would submit Rust and Swift as "decent" typ
by cballard 10y ago
C# and Java optionals aren't very useful, since they would be reference types themselves, and thus could be null!
I would submit Rust and Swift as "decent" type systems, if Haskell is the standard for "good". They do nullability correctly, but lack HKTs.
- jdmichal 10y agoC# has non-nullable value types via the `struct` keyword. And C# in fact already has a defined optional type to handle this; it's called `Nullable`. [0] [0] https://msdn.microsoft.com/en-us/library/b3h38hb0%28v=vs.110%29.aspx https://msdn.microsoft.com/en-us/library/b3h38hb0%28v=vs.110...
- krotton 10y agoIn Scala, Option[Whatever] may also be null. The difference is that it's considered "some Java compatibility leftover" and never exploited by any sane piece of code.