{"id":14008301,"url":"https://github.com/Kwasniok/LambdaCalculus","last_synced_at":"2025-07-24T03:32:34.549Z","repository":{"id":219553798,"uuid":"305546668","full_name":"Kwasniok/LambdaCalculus","owner":"Kwasniok","description":"lambda calculus in haskell","archived":false,"fork":false,"pushed_at":"2020-11-01T19:55:14.000Z","size":38,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"default","last_synced_at":"2024-08-10T11:02:55.378Z","etag":null,"topics":["evaluation","haskell","lambda-calculus","lambda-expressions","parse","valid"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/Kwasniok.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":"2020-10-20T00:30:42.000Z","updated_at":"2024-08-10T11:02:57.334Z","dependencies_parsed_at":null,"dependency_job_id":"35e814d3-2f23-41cd-8542-c7bbe8cf3e66","html_url":"https://github.com/Kwasniok/LambdaCalculus","commit_stats":null,"previous_names":["kwasniok/lambdacalculus"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwasniok%2FLambdaCalculus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwasniok%2FLambdaCalculus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwasniok%2FLambdaCalculus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kwasniok%2FLambdaCalculus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kwasniok","download_url":"https://codeload.github.com/Kwasniok/LambdaCalculus/tar.gz/refs/heads/default","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227410574,"owners_count":17774770,"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":["evaluation","haskell","lambda-calculus","lambda-expressions","parse","valid"],"created_at":"2024-08-10T11:01:34.133Z","updated_at":"2024-11-30T19:30:58.141Z","avatar_url":"https://github.com/Kwasniok.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# Lambda Calculus\nA small [cabal](https://www.haskell.org/cabal/) package for haskell featuring the basic operations of lambda calculus.\n\n## Feature List\n- Representation of objects in lambda calculus as data structures\n- IO of lambda expressions\n- Validity check of lambda expressions\n- Stepwise evaluation of lambda expressions\n\n## Installation\nInstallation of this library via [cabal](https://www.haskell.org/cabal/) package manager:\n```\ncabal instal --lib\n```\nThis will register the package for [GHC](https://www.haskell.org/ghc/) as well.\n\n## Usage\nAfter a succeccfull installation all modules are known to and importable from within GHC/GHCI.\n\n### Modules\n- `Lambda.Data` contains all data structures representing the lambda calculus and output functions (`show`)\n- `Lambda.Parse` contains a parser function for all data structures\n- `Lambda.Evaluation` contains functions related to expression evaluation\n\n### Notation\nThe standard notation ~`λx. λy. x y`~ is represented as `\\x. (\\y. (x y))` with explicit **parentheses around each function body** if more than one term is present and exactly **one parameter per function**.\nOther **term lists** have to be placed **within parentheses** as well: ~`(λx. λy. x y) a b`~ becomes `(\\x. (\\y. (x y)) a b)`.\n\n## Examples\n### Input/Output\nUse `parse` to parse a grammatical data structure like `word` (top level structure):\n```\n\u003e import Lambda.Parse\n\u003e parse word \"\\\\a. \\\\b. (a b)\"\nJust (\\a. (\\b. (a b)))\n\u003e\n```\n\nPrinting is implicit for each line but one can use `show` to turn a grammatical data structure into a string as a in:\n```\n\u003e import Lambda.Parse\n\u003e w = parse word \"\\\\a. \\\\b. (a b)\"\n\u003e show w\n\"Just (\\a. (\\b. (a b)))\"\n\u003e\n```\n\n### Check Validity\nTo check the validity of a lambda expression use `valid` as in:\n```\n\u003e import Lambda.Parse\n\u003e import Lambda.Evaluate\n\u003e import Data.Maybe\n\u003e w = w = fromJust (parse word \"(\\\\x. \\\\y. (x y) \\\\y. (y z))\")\n\u003e valid w\nTrue\n\u003e w = w = fromJust (parse word \"(\\\\x. \\\\x. (x y) \\\\y. (y z))\")\n\u003e valid w\nFalse\n\u003e \n```\n\n### Evaluation (Stepwise)\nTo perform a single evaluation step (for any **valid** lambda expression) use `eval` as in:\n```\n\n\u003e import Lambda.Evaluate\n\u003e import Lambda.Parse\n\u003e import Data.Maybe\n\u003e w = fromJust $ parse word \"(\\\\x. \\\\y. (x y) a b)\"\n\u003e iterate eval w !! 0\n((\\x. (\\y. (x y))) a b)\n\u003e iterate eval w !! 1\n((\\y. (a y)) b)\n\u003e iterate eval w !! 2\n(a b)\n\u003e iterate eval w !! 3\n(a b)\n\u003e\n```\n\n## Dependencies\n- haskell compiler: [ghc](https://www.haskell.org/ghc/) v4.9.0.0 or newer\n    - archlinux: [ghc package](https://www.archlinux.org/packages/community/x86_64/ghc/) (may require further packages)\n- haskell package manager: [cabal](https://www.haskell.org/cabal/) v2.4 or newer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKwasniok%2FLambdaCalculus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKwasniok%2FLambdaCalculus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKwasniok%2FLambdaCalculus/lists"}