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 upResult.mapX should be Result.foldlX ? #675
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
process-bot
Jul 25, 2016
Thanks for the issue! 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
Jul 25, 2016
|
Thanks for the issue! 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.
jvoigtlaender
Jul 25, 2016
Contributor
If you want to discuss this, please bring it up in a community forum, for example the mailing list. Various options/channels are listed here: http://elm-lang.org/community.
This issue tracker here is not meant for such questions on API design and function names. It is really almost exclusively meant for bug reports.
|
If you want to discuss this, please bring it up in a community forum, for example the mailing list. Various options/channels are listed here: http://elm-lang.org/community. This issue tracker here is not meant for such questions on API design and function names. It is really almost exclusively meant for bug reports. |
listrophy commentedJul 25, 2016
It seems to me that
Result.map2,Result.map3, etc should actually be calledResult.foldl2,Result.foldl3, etc.As I understand it,
mapshould be fully parallelizable, applying a func to items in a list without regard to the other items in the list. On the other hand,foldlreduces the dimensionality of the input values, often from 2 to 1.Going further, perhaps there should be a
Result.foldlwith the type signature:foldl : (a -> value -> value) -> value -> List (Result x a) -> Result x valueNB: Forgive my inexperience in the FP world... this issue is coming from my experience as an OO programmer. For example, I nearly submitted this issue with😀
reducerather thanfoldl.