Closed davidchambers closed 3 years ago
Thanks for the review, Aldwin. I will leave this pull request open for a few days to give others the opportunity to comment.
Thanks, Gabe! findMap
is a good name. Better than findMaybe
, do you think? I am not attached to findMaybe
.
I like findMap
because it suggests that you're likely modifying the value you find. I don't have any real attachment though, just thought it useful to point toward some prior art.
Superseded by #698
With
find
one sometimes applies a transformation to determine whether an element is suitable only to apply the transformation a second time if a suitable element is found:With
findMaybe
the transformation is provided just once:As is often the case, the function's type is obvious but its name is not. What do you think of the name
findMaybe
? It follows the precedent set bymap
andmapMaybe
, although the correspondence is imprecise.