Re:Making the move from Scala to Go
by aninhumer on Thursday January 26, 2017 @04:10AM
(#13489862)
There are many things you can express with ADTs that you can't express with nullable types, and once you have those, Option is simpler than extending the type system.
EDIT: Another thing you can do with Option is define generic abstractions that work on it and other types, like map/flatMap. This in turn means you can write generic functions over anything that can be flatMapped which work automatically for Options. (I don't know if there's anything equivalent in Kotlin though?)
EDIT: Another thing you can do with Option is define generic abstractions that work on it and other types, like map/flatMap. This in turn means you can write generic functions over anything that can be flatMapped which work automatically for Options. (I don't know if there's anything equivalent in Kotlin though?)