sitepodmatt
03/08/2019, 1:05 PM// arrow
val port = Option.fromNullable(System.getenv("PORT")).flatMap { it ->
it.toIntOrNull()?.let { Some(it) } ?: None
}.getOrElse { 8080 }
// non-arrow
val port2 = System.getenv("PORT")?.toIntOrNull() ?: 8080
is there any terser way in arrow?