3 ms·
I can't really think of a way in which I'd consider the monadic version better-or-equal than the "traditional approach". Except that maaaaybe ``` ageNext = age
by levzettelin 3y ago
I can't really think of a way in which I'd consider the monadic version better-or-equal than the "traditional approach". Except that maaaaybe
```
ageNext = age.transform([] (const int age) { return age + 1; });
```
if equally readable to
```
if (age) {
ageNext = *age + 1;
}
```
Maaaaaybe!
- nitnelave 3y agoFor single operations, maybe (and still it's a style, you get used to it), but the value comes from chaining. For me, the user/ageNext example is much more readable with monads. That might also be because I'm used to monads with Rust.