{"id":35190464,"url":"https://github.com/phrenotype/lambda","last_synced_at":"2025-12-29T05:38:51.336Z","repository":{"id":62501163,"uuid":"423575766","full_name":"phrenotype/lambda","owner":"phrenotype","description":"Converts functions to lambdas","archived":false,"fork":false,"pushed_at":"2023-03-17T14:44:12.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-11T01:29:38.618Z","etag":null,"topics":["curry","currying","function-application","functional-programming","lambda","lambda-functions","partial-application"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/phrenotype.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":"2021-11-01T18:35:19.000Z","updated_at":"2022-12-21T17:41:09.000Z","dependencies_parsed_at":"2022-11-02T11:47:33.490Z","dependency_job_id":null,"html_url":"https://github.com/phrenotype/lambda","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phrenotype/lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Flambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Flambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Flambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Flambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phrenotype","download_url":"https://codeload.github.com/phrenotype/lambda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phrenotype%2Flambda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28111198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-29T02:00:07.021Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["curry","currying","function-application","functional-programming","lambda","lambda-functions","partial-application"],"created_at":"2025-12-29T05:38:38.465Z","updated_at":"2025-12-29T05:38:51.330Z","avatar_url":"https://github.com/phrenotype.png","language":"PHP","readme":"# Lambda\n![github stars](https://img.shields.io/github/stars/phrenotype/lambda?style=social)\n![license](https://img.shields.io/github/license/phrenotype/lambda)\n![contributors](https://img.shields.io/github/contributors/phrenotype/lambda)\n![code size](https://img.shields.io/github/languages/code-size/phrenotype/lambda)\n\n\nThis is a library for converting both named and annonymous php functions into lambda expressions.  This the allows them to be curried and partially applied.\n\n## Install  \n`composer require phrenotype/lambda`  \n\n## Examples\n\n#### With all parameters required  \n\n```php\n$add = lambda(function($a, $b, $c){\n\treturn $a + $b + $c;\n});\n\necho $add(4,5,2);\necho $add(4,5)(2);\necho $add(4)(5,2);\necho $add(4)(5)(2);\n```\n\n#### With optional parameters  \nThis is a little bit tricky.  \n\n```php\n$add = lambda(function($a, $b, $c=2){\n\treturn $a + $b + $c;\n});\n```\n\nThe key thing to remember is that once the numbers of arguments applied ***exactly matches*** the required number of arguments, It will return a result, not a lambda. So, in applying arguments, do not apply them curry style when dealing with optional parameters. Use partial application instead.\n\n```php\necho $add(4,5,2); // Ok\necho $add(4)(5,2) // Ok\necho $add(4,5)(2); // Error\necho $add(4)(5)(2); //Error\n```\n\n## Contact  \n**Email** : paul.contrib@gmail.com","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrenotype%2Flambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphrenotype%2Flambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrenotype%2Flambda/lists"}