Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upReplace andThen with flatMap. #910
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Sep 26, 2017
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
process-bot
commented
Sep 26, 2017
|
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it! Here is what to expect next, and if anyone wants to comment, keep these things in mind. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Josef-Vonasek
Sep 26, 2017
The tests are currently failing, but my time is spare.
Is this pull request acceptable? If yes, I will fix the code, so that all test will pass. If not, I am just going to close this pull request.
Josef-Vonasek
commented
Sep 26, 2017
|
The tests are currently failing, but my time is spare. Is this pull request acceptable? If yes, I will fix the code, so that all test will pass. If not, I am just going to close this pull request. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Sep 26, 2017
Member
I considered this name alongside other options when I chose andThen. I do not think it makes sense to make this change.
|
I considered this name alongside other options when I chose |
Josef-Vonasek commentedSep 26, 2017
•
edited
Edited 1 time
-
Josef-Vonasek
edited Sep 26, 2017 (most recent)
I find the name
flatMapvery natural fit for the signature(a -> (Box a)) -> Box a -> Box b. After all the first thing that comes onto my mind, when I see flatMap is flatten and map.It is then not hard to figure out that it should probably behave like
andThenon the other hand feels very opaque and / or vague (e.g.|>is very often called andThen) and without documentation I would have no idea would does it do.