{"id":18774514,"url":"https://github.com/mmzk1526/lambda_calculus","last_synced_at":"2025-09-20T22:15:31.918Z","repository":{"id":100268460,"uuid":"550191963","full_name":"MMZK1526/lambda_calculus","owner":"MMZK1526","description":"Dart package for Lambda Calculus","archived":false,"fork":false,"pushed_at":"2023-12-09T21:32:38.000Z","size":313,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-21T02:46:30.391Z","etag":null,"topics":["dart","functional-programming","lambda-calculus","simulator","type-system"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/lambda_calculus","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MMZK1526.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-12T10:54:57.000Z","updated_at":"2023-07-17T20:52:46.000Z","dependencies_parsed_at":"2023-11-08T13:25:29.793Z","dependency_job_id":"dae36d3f-277f-4ce7-8bea-14e0d91aa732","html_url":"https://github.com/MMZK1526/lambda_calculus","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/MMZK1526/lambda_calculus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMZK1526%2Flambda_calculus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMZK1526%2Flambda_calculus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMZK1526%2Flambda_calculus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMZK1526%2Flambda_calculus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MMZK1526","download_url":"https://codeload.github.com/MMZK1526/lambda_calculus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MMZK1526%2Flambda_calculus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276166658,"owners_count":25596467,"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-09-20T02:00:10.207Z","response_time":63,"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":["dart","functional-programming","lambda-calculus","simulator","type-system"],"created_at":"2024-11-07T19:38:29.201Z","updated_at":"2025-09-20T22:15:31.854Z","avatar_url":"https://github.com/MMZK1526.png","language":"Dart","readme":"# lamdba-calculus\n\n## Introduction\n\nA Lambda Calculus parser \u0026 evaluator in `dart`.\n\nUse `import 'package:lambda_calculus/lambda_calculus.dart';` to use this library.\n\nCurrently, it supports evaluating untyped Lambda Calculus as well as type inference.\n\nCheck out the [quickstart](#quickstart) for a quick usage guide.\n\nIf you notice any issues or have any suggestions, please feel free to open an issue or contact me via email.\n\n## Quickstart\n\n```dart\nimport 'package:lambda_calculus/lambda_calculus.dart';\n\n// Parse a lambda expression\n// the lambda character 'λ' can be replaced by '/' or '\\' for convenience;\nfinal yCombinator = r'/x. (\\y -\u003e x (\\z. y y z)) (/y. x (/z. y y z))'.toLambda()!;\n// The output tries its best to preserve the variable names.\nprint(yCombinator);\n\n// Church numbers\nfinal fortyTwo = 42.toChurchNumber();\nfinal iiyokoiyo = 114514.toChurchNumber(); // I wouldn't try to print out this one...\n\n// Evaluate a lambda expression\n// Note that we use `LambdaBuilder` to constructor lambda expressions bottom-up.\n// We need to call the `build` method at the end to get the final lambda\n// expression.\n// Both `LambdaBuilder` and `Lambda` provides a number of constants and\n// combinators for convenience.\nfinal twoTimesThree = LambdaBuilder.applyAll([\n  LambdaBuilder.constants.lambdaTimes(),\n  2.toChurchNumberBuilder(),\n  3.toChurchNumberBuilder(),\n]).build();\nfinal evalOneStep = twoTimesThree.eval1();\n// Note that the 'eval' function does not terminate if the term does not have\n// a normal form.\nfinal callByValueResult = twoTimesThree.eval();\nfinal callByNameResult = twoTimesThree.eval(LambdaEvaluationType.callByName);\nfinal fullReductionResult = twoTimesThree.eval(LambdaEvaluationType.fullReduction);\nprint(fullReductionResult); // Same as `LambdaConstants.six()` or `6.toChurchNumber()`\n\n// Find the type of a lambda expression;\nfinal term = r'\\x. \\y. x y'.toLambda()!;\nprint(term.findType()); // (t1 -\u003e t2) -\u003e (t1 -\u003e t2)\n// The Y-combinator has no type under the Hindley-Milner type system\nprint(yCombinator.findType()); // null\n```\n\nSee [here](example/example.dart) for more examples.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmzk1526%2Flambda_calculus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmzk1526%2Flambda_calculus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmzk1526%2Flambda_calculus/lists"}