{"id":13593531,"url":"https://github.com/jimouris/lambda-calculus-interpreter","last_synced_at":"2025-04-08T20:31:07.073Z","repository":{"id":69912388,"uuid":"50543193","full_name":"jimouris/lambda-calculus-interpreter","owner":"jimouris","description":"⚙️ A simple lambda (λ) calculus interpreter","archived":false,"fork":false,"pushed_at":"2018-09-12T07:03:01.000Z","size":99,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T16:47:47.693Z","etag":null,"topics":["church-numerals","haskell","lambda","lambda-calculus","lambda-calculus-interpreter"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/jimouris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-01-27T22:40:46.000Z","updated_at":"2022-05-12T08:42:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"af40de7f-4144-4eb7-a091-646467a5d777","html_url":"https://github.com/jimouris/lambda-calculus-interpreter","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/jimouris%2Flambda-calculus-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimouris%2Flambda-calculus-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimouris%2Flambda-calculus-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimouris%2Flambda-calculus-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimouris","download_url":"https://codeload.github.com/jimouris/lambda-calculus-interpreter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223343454,"owners_count":17129950,"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":["church-numerals","haskell","lambda","lambda-calculus","lambda-calculus-interpreter"],"created_at":"2024-08-01T16:01:21.265Z","updated_at":"2024-11-06T12:52:27.112Z","avatar_url":"https://github.com/jimouris.png","language":"Haskell","readme":"# λ-Calculus Interpreter [![License MIT][badge-license]](LICENSE.txt)\nA simple lambda calculus interpreter\n\n## 2 Modes:\n#### 1) Give lambda expressions:\n1. λ : \\\\\n2. e.g. \"\\\\x.\\\\y.x\"\n```\n\u003e reduceNF (myparse \"(\\\\x.\\\\y.zxy)w\")\n[\"(\\\\x.\\\\y.zxy)w\", \"\\\\b.zwb\", \"zw\"]\n\n\u003e reduceNF (myparse \"(\\\\x.\\\\y.zxy)(wy)\")\n[\"(\\\\x.\\\\y.zxy)(wy)\", \"\\\\b.z(wy)b\", \"z(wy)\"]\n\n\u003e reduceNF (myparse \"(\\\\n.\\\\f.\\\\x.nf(fx))(\\\\f.\\\\x.fx)\")\n[\"(\\\\n.\\\\f.\\\\x.nf(fx))(\\\\f.\\\\x.fx)\", \"\\\\b.\\\\c.(\\\\f.\\\\x.fx)b(bc)\", \"\\\\b.\\\\c.(\\\\c.bc)(bc)\", \"\\\\b.\\\\c.b(bc)\"]\n```\n#### 2) Give fixed terms (true, false, chuch 2, etc):\n1. true       : chTrue\n2. false      : chFalse\n3. ifthenelse : chCond\n4. church num : church\n5. succ       : chSucc\n6. plus       : chPlus\n7. mult       : chMult\n8. exp        : chExp\n9. iszero     : chIsZero\n10. pair      : chPair\n11. fst       : chFst\n12. snd       : chSnd\n13. and       : chAnd\n14. or        : chOr\n```\n\u003e prettyprint (chSucc (church 2))\n\"\\\\f.\\\\x.f(f(fx))\"\n\n\u003e prettyprint (chIsZero (church 0))\n\"\\\\x.\\\\y.x\"\n\n\u003e prettyprint (chPlus (chSucc (church 2)) (church 3))\n\"\\\\f.\\\\x.f(f(f(f(f(fx)))))\"\n\n\u003e prettyprint (chMult (church 2) (church 3))\n\"\\\\f.\\\\b.f(f(f(f(f(fb)))))\"\n\n\u003e prettyprint (chExp (church 2) (church 3))\n\"\\\\b.\\\\c.b(b(b(b(b(b(b(bc)))))))\"\n\n\u003e prettyprint (chNot chFalse)\n\"\\\\x.\\\\y.x\"\n\n\u003e prettyprint (chSnd (chPair (church 2) (church 3)))\n\"\\\\f.\\\\x.f(f(fx))\"\n\n\u003e prettyprint (chOr chFalse  chTrue)\n\"\\\\x.\\\\y.x\"\n```\n\n2015-2016\n\n\n[badge-license]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square\n","funding_links":[],"categories":["Haskell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimouris%2Flambda-calculus-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimouris%2Flambda-calculus-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimouris%2Flambda-calculus-interpreter/lists"}