Skip to content
loading...

re: Make impossible states impossible - Kotlin edition VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Big fan of such (Functional) domain modelling. What's your take on the Null vs Option vs Either? From my perspective: Null and Option have a simi...
 

I've had the exact same dilemma and for the moment my loosely-held conclusion is that Option is unnecessary in Kotlin. Perhaps if you use Arrow it provides syntax sugar with monad comprehensions but I wouldn't say that's a good enough reason to use it over built-in nullables.

The only case where I think using Option or Optional has an advantage is when your code needs to be used from Java and you want to keep null-safety. Would this apply to Typescript and Javascript?

code of conduct - report abuse