{"id":21493506,"url":"https://github.com/alienkevin/curry-macro","last_synced_at":"2025-07-15T19:30:56.717Z","repository":{"id":57614852,"uuid":"251284749","full_name":"AlienKevin/curry-macro","owner":"AlienKevin","description":"Have fun currying using Rust's native closure syntax","archived":false,"fork":false,"pushed_at":"2020-03-30T12:05:09.000Z","size":2,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-21T22:39:24.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/AlienKevin.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":"2020-03-30T11:29:33.000Z","updated_at":"2024-08-13T15:18:58.000Z","dependencies_parsed_at":"2022-08-27T00:43:15.700Z","dependency_job_id":null,"html_url":"https://github.com/AlienKevin/curry-macro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fcurry-macro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fcurry-macro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fcurry-macro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienKevin%2Fcurry-macro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlienKevin","download_url":"https://codeload.github.com/AlienKevin/curry-macro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226064547,"owners_count":17568034,"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","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":[],"created_at":"2024-11-23T15:43:08.435Z","updated_at":"2024-11-23T15:43:09.054Z","avatar_url":"https://github.com/AlienKevin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# curry-macro\n\nHave fun currying using Rust's native closure syntax.\n\n# Example\n\nYou can curry an add function that adds two numbers.\n\nFirst, import the curry macro:\n```rust\nuse curry_macro::curry;\n```\nThen, you have three forms of function definitions to choose from:\n\n1. Simplest form, without any type annotations.\nYou need to use the curried function so that\nthe rust compiler can infer the input and return\ntypes for you:\n```rust\nlet add = curry!(|a, b| a + b);\nassert_eq!(add(1)(2), 3);\n```\n\n2. With input type annotations:\n```rust\nlet add = curry!(|a: i32, b: i32| a + b);\n```\n\n3. With input and return type annotations and a block as function body\n```rust\nlet add = curry!(|a: i32, b: i32| -\u003e i32 { a + b });\n```\n\nThe above three functions work the same:\n```rust\n// You can generate intermediate functions that are partially applied:\nlet add1_to = add(1);\nlet sum = add1_to(2);\nassert_eq!(sum, 3);\n// You can also can apply all arguments at once:\nlet sum = add(1)(2);\nassert_eq!(sum, 3);\n```\n\n# Credits\nBig thanks to Korede-TA for his awesome [curry-macro](https://github.com/Korede-TA/curry-macro).\n\n# License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falienkevin%2Fcurry-macro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falienkevin%2Fcurry-macro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falienkevin%2Fcurry-macro/lists"}