4 ms·
The two blocks of code are exactly equivalent, the "if != null" logic is moved into the <-.
by vilhelm_s 9y ago
The two blocks of code are exactly equivalent, the "if != null" logic is moved into the <-.
- dullgiulio 9y agoAnd the first snipped is purposely badly written. One can use early returns to make code flat just like the monadic example.
- mclehman 9y agoSure, you can flatten that example, but I'd still be interested in losing the explicit and repetitive null checks.
- andrewprock 9y agoIn the old days, we used #define macros to do that.