{"id":13735209,"url":"https://github.com/mtso/hof","last_synced_at":"2026-01-23T14:03:41.924Z","repository":{"id":56195768,"uuid":"107704901","full_name":"mtso/hof","owner":"mtso","description":"Higher-order functions in different languages.","archived":false,"fork":false,"pushed_at":"2020-11-21T06:45:53.000Z","size":38,"stargazers_count":5,"open_issues_count":3,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T11:42:46.627Z","etag":null,"topics":["example-code","higher-order-functions","hof"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-20T17:05:56.000Z","updated_at":"2020-11-21T06:45:56.000Z","dependencies_parsed_at":"2022-08-15T14:31:00.545Z","dependency_job_id":null,"html_url":"https://github.com/mtso/hof","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mtso/hof","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtso%2Fhof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtso%2Fhof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtso%2Fhof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtso%2Fhof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtso","download_url":"https://codeload.github.com/mtso/hof/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtso%2Fhof/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28693459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["example-code","higher-order-functions","hof"],"created_at":"2024-08-03T03:01:04.208Z","updated_at":"2026-01-23T14:03:41.901Z","avatar_url":"https://github.com/mtso.png","language":"TypeScript","funding_links":[],"categories":["Repository List"],"sub_categories":[],"readme":"# Higher-Order Functions\n\nHigher-order functions in different languages. Inspired by: [FizzBuzz](https://github.com/zenware/FizzBuzz) and [hello-world](https://github.com/leachim6/hello-world).\n\nHigher-order functions (HOF) are functions that satisfy one or both rules:\n- Returns a function.\n- Take one or more function parameters.\n\n## Spec\n\nThe two example higher-order functions are:\n\n### `add`\n\n`add` takes an integer as a parameter and returns a second function that takes an integer, which returns the overall result.\n\n##### type signature\n```\nfunction(int) -\u003e function(int) -\u003e int\n```\n\n### `each`\n`each` is a void function takes a list as its first parameter and a function as its second parameter. It then iterates over the given list passing in each element into the function.\n\n##### type signature\n```\nfunction([int], function(int) -\u003e void) -\u003e void\n```\n\n#### Example Usage\n\nShow how the function is used by calling them in the program's entry point. For example:\n```js\nconst three = add(1)(2);\neach([1, 2, 3], console.log);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtso%2Fhof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtso%2Fhof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtso%2Fhof/lists"}