Skip to content

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

@glts

Description

@glts

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions