New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result.mapX should be Result.foldlX ? #675

Closed
listrophy opened this Issue Jul 25, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@listrophy

listrophy commented Jul 25, 2016

It seems to me that Result.map2, Result.map3, etc should actually be called Result.foldl2, Result.foldl3, etc.

As I understand it, map should be fully parallelizable, applying a func to items in a list without regard to the other items in the list. On the other hand, foldl reduces the dimensionality of the input values, often from 2 to 1.

Going further, perhaps there should be a Result.foldl with the type signature: foldl : (a -> value -> value) -> value -> List (Result x a) -> Result x value

NB: 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 reduce rather than foldl. 😀

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

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.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

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.

Contributor

jvoigtlaender commented Jul 25, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment