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

‘extent’ implementation is misleading, never uses parallel fold #21

Open
glts opened this issue May 11, 2018 · 0 comments
Open

‘extent’ implementation is misleading, never uses parallel fold #21

glts opened this issue May 11, 2018 · 0 comments

Comments

@glts
Copy link

glts commented May 11, 2018

huri.core/extent uses clojure.core.reducers/fold in its implementation. However, no possible inputs can trigger actual parallel folding; extent always degenerates to plain reduce. This is because all inputs result in r/fold being applied to a sequence, which is not a foldable collection.

Furthermore, if the parallel fold were actually triggered, extent would always throw an exception because the combining function (here same as the reducing function) doesn’t work.

To address this the alternatives are:

  • Replace r/fold with reduce.
  • Allow foldable inputs to be passed through to r/fold and supply an appropriate combining function.
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