Hacker News new | ask | show | jobs
by gavinray 1494 days ago
Philosophical bits aside, it's worth noting that in Kotlin, nullable values have somewhat similar operators as Maybe/Option types in other languages

There's safe-access "?." and ".let", which only fires if the receiver is non-nullable

  api.getUser(1)?.let { user -> println("user was not null") }