Skip to content
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

Be more precise about left vs right in Foldable doc #2251

Merged
merged 1 commit into from
May 10, 2018

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented May 9, 2018

With the previous wording, a reader might interpret the Foldable docs
as suggesting that foldLeft traverses the structure from the left
while foldRight traverses the structure from the right. In my
experience, this is a common misconception. In fact, foldRight can
terminate on infinite structures while foldLeft can't, which doesn't
make sense if you are thinking about the two as traversal order. I've
tried to be more precise about Left and Right referring to the
associativity of the operations. I'm not sure whether my List(1, 2, 3)
example is very good or not -- open to feedback

With the previous wording, a reader might interpret the `Foldable` docs
as suggesting that `foldLeft` traverses the structure from the left
while `foldRight` traverses the structure from the right. In my
experience, this is a common misconception. In fact, `foldRight` can
terminate on infinite structures while `foldLeft` can't, which doesn't
make sense if you are thinking about the two as traversal order. I've
tried to be more precise about `Left` and `Right` referring to the
associativity of the operations. I'm not sure whether my `List(1, 2, 3)`
example is very good or not -- open to feedback
Copy link
Contributor

@kailuowang kailuowang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Copy link
Member

@LukaJCB LukaJCB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! 👍

@codecov-io
Copy link

codecov-io commented May 10, 2018

Codecov Report

Merging #2251 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2251   +/-   ##
=======================================
  Coverage   94.96%   94.96%           
=======================================
  Files         333      333           
  Lines        5797     5797           
  Branches      221      221           
=======================================
  Hits         5505     5505           
  Misses        292      292

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 680a517...4bf3dbd. Read the comment docs.

@LukaJCB LukaJCB merged commit cb2a08b into typelevel:master May 10, 2018
@kailuowang kailuowang added this to the 1.2 milestone May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants