3 ms·
I'm mostly agreeing with both you and the sibling - flow-sensitive typing is great. I think it's awesome in Kotlin, and removes the Java-style casting or manual
by blandflakes 6y ago
I'm mostly agreeing with both you and the sibling - flow-sensitive typing is great. I think it's awesome in Kotlin, and removes the Java-style casting or manual unwrapping inside of if guards you always end up with.
As sibling said, ML-style languages get away with this a different way - chained "container" operations in Scala, for example, are "right-biased", so the only get called if the result of the preceding operation was a success or not null.
I've heard it called "Railway Oriented Programming": https://fsharpforfunandprofit.com/rop/ https://fsharpforfunandprofit.com/rop/