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

Typo: `foldl` instead of `foldr` in the documentation #788

Open
sbarzowski opened this issue Apr 1, 2020 · 1 comment
Open

Typo: `foldl` instead of `foldr` in the documentation #788

sbarzowski opened this issue Apr 1, 2020 · 1 comment
Labels

Comments

@sbarzowski
Copy link
Collaborator

@sbarzowski sbarzowski commented Apr 1, 2020

image

It should be "Classic foldr" function.

We should also provide examples when we're at it.

@sbarzowski
Copy link
Collaborator Author

@sbarzowski sbarzowski commented Apr 1, 2020

Some examples:

[
  std.foldl(function(x, y) x + y, ["a", "b", "c"], "I"),
  std.foldr(function(x, y) x + y, ["a", "b", "c"], "I"),
  std.foldl(function(x, y) 'f(' + x + ',' + y + ')', [1, 2, 3], "init"),
  std.foldr(function(x, y) 'f(' + x + ',' + y + ')', [1, 2, 3], "init"),
 ]

results in:

[
  "Iabc",
  "abcI",
  "f(f(f(init,1),2),3)",
  "f(1,f(2,f(3,init)))"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.