Open googleson78 opened 1 year ago
I personally find it desirable because the maybe
usage is essentially reimplementing traverse
, i.e. this is exactly the implementation of traverse
.
I do agree that type inference is worse with this hint, and potentially (although I'm not sure when), this might cause ambiguity errors. Perhaps some optional group might be better here?
Definitely not in base, which in general doesn't do generalization. But further down there is a set of hints called generalised, where maybe to traverse would fit nicely. Happy to take the patch if adjusted to go there.
Why is this desirable? The
maybe
function is more targeted so helps enforce types better.