{"id":26207211,"url":"https://github.com/oelin/hyper-reducer","last_synced_at":"2026-04-24T10:32:26.051Z","repository":{"id":65696177,"uuid":"597031792","full_name":"oelin/hyper-reducer","owner":"oelin","description":"A generalization of reduce() to arbitrary arity.","archived":false,"fork":false,"pushed_at":"2023-02-03T13:39:28.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T22:34:27.708Z","etag":null,"topics":["functional-programming","reduce","reduction"],"latest_commit_sha":null,"homepage":"https://npmjs.com/hyper-reducer","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oelin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-02-03T13:29:46.000Z","updated_at":"2023-02-07T15:36:23.000Z","dependencies_parsed_at":"2023-02-18T07:30:58.381Z","dependency_job_id":null,"html_url":"https://github.com/oelin/hyper-reducer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/oelin/hyper-reducer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fhyper-reducer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fhyper-reducer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fhyper-reducer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fhyper-reducer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oelin","download_url":"https://codeload.github.com/oelin/hyper-reducer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oelin%2Fhyper-reducer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32218957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional-programming","reduce","reduction"],"created_at":"2025-03-12T05:31:16.689Z","updated_at":"2026-04-24T10:32:26.034Z","avatar_url":"https://github.com/oelin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hyper-reducer\n\nA generalization of `reduce()` to arbitrary arity.\n\n\n## Introduction\n\nReduction is a key concept in functional programming which encapsulates the idea of recursively transforming state based on a sequence of input. More concretely, `reduce()` takes two values (one of which is the previous output), and returns another value. In contrast, `reduceN()` takes `N + 1` values (it has arbitrary arity). Although `reduceN()` can ultimately be *reduced to* regular `reduce()`, the construction makes certain operations easier to understand and implement.\n\n\n## Insallation\n\n```sh\nnpm i hyper-reducer\n```\n\n\n## Usage\n\n```js\nimport hyperReducer from 'hyper-reducer'\n\nconst reduce2 = hyperReducer(2) // Reduction with arity 2.\n\nconst array = [1, 2, 3, 4, 5, 6]\n\nreduce2(array, (a, b0, b1) =\u003e a*b0 + b1, initial=[1, 1]) // Returns 10\n```\n\nThe `hyperReducer()` function takes an arity argument and returns a concrete reducer with that arity. The reducer then takes an array, callback function and (optional) initial set of previous outputs. The initial outputs are set to zero by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foelin%2Fhyper-reducer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foelin%2Fhyper-reducer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foelin%2Fhyper-reducer/lists"}