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

Consider simplifying fold #20

Open
hannobraun opened this issue Nov 30, 2019 · 0 comments
Open

Consider simplifying fold #20

hannobraun opened this issue Nov 30, 2019 · 0 comments

Comments

@hannobraun
Copy link
Owner

In addition to a list and an anonymous function,fold also accepts an initial value.

Example:

1 [ 2 3 ] [ + ] fold # evaluates to `6`

It would be simpler to drop the first argument:

[ 2 3 ] [ + ] fold # evaluates to `5`

If an initial value is needed, it can be easily added to the list:

[ 2 3 ] 1 prepend [ + ] fold # evaluates to `6`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant