![]() (In fact, this case has convinced me that union types in general are a bad idea). Nullability as a special case in the language model is a terrible idea, because it doesn't compose properly in generic cases. Pretty sure I'm not going to be converted or anything like that, but I wouldn't mind if scala borrowed a few features from a language that borrowed features from it. Just been reading about Kotlin and this one stood out. I guess it's basically just syntactical sugar, but seems like something that could be compiler optimized as well so that recursive or uncertain calls maybe prioritize null values or perhaps treat it as a tail call. My point with the last one is that it prevents one of the biggest problems that come up in terms of design and representation, as well as maybe automatically collapses a lot of the presumed assumptions about behavior. It's great, but it's less intuitive and excessively verbose for the main use case it facilitates. I'll admit, it's a lot cleaner and more intuitive way to represent Monadic expressions, or a clean-up of the whole Option, Some, None stuff. ![]() Null checks are required and enforced by the compiler. This is indicated with a ? on the type name, eg String? may be null, String may not. Kotlin treats a nullable reference as a different type as a non-nullable reference. Want your library here? Message the moderators! Open Source Applications written in Scala Introduction to Programming with Dependent Types in Scala (advanced).Functional Programming Principles in Scala.Functional Programming in Scala (Manning).Scala Center (not-for-profit scala org).Try Scala Online with Scastie or ScalaFiddle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |