I often see in vavr-based code:
...
.map(x -> {
if (someCondition(x)) {
return doWith(x);
} else {
return x;
}
})
...
Is there any way to eliminate this logic from map
call using some constructs? I find this if
condition awkward.