{"id":19210305,"url":"https://github.com/glubs9/firstlambdacalculusinterpreterinhaskell","last_synced_at":"2025-10-09T15:24:26.810Z","repository":{"id":137536814,"uuid":"320223399","full_name":"Glubs9/FirstLambdaCalculusInterpreterInHaskell","owner":"Glubs9","description":"This is the first successful lambda calculus interpreter I have written, and it was written in haskell.","archived":false,"fork":false,"pushed_at":"2020-12-18T02:09:31.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T07:31:38.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/Glubs9.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-10T09:33:06.000Z","updated_at":"2020-12-18T02:09:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3184726-bea3-4749-ac5b-7f7da9006736","html_url":"https://github.com/Glubs9/FirstLambdaCalculusInterpreterInHaskell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Glubs9/FirstLambdaCalculusInterpreterInHaskell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glubs9%2FFirstLambdaCalculusInterpreterInHaskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glubs9%2FFirstLambdaCalculusInterpreterInHaskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glubs9%2FFirstLambdaCalculusInterpreterInHaskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glubs9%2FFirstLambdaCalculusInterpreterInHaskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Glubs9","download_url":"https://codeload.github.com/Glubs9/FirstLambdaCalculusInterpreterInHaskell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glubs9%2FFirstLambdaCalculusInterpreterInHaskell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001641,"owners_count":26083147,"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-10-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2024-11-09T13:35:39.987Z","updated_at":"2025-10-09T15:24:26.793Z","avatar_url":"https://github.com/Glubs9.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FirstLambdaCalculusInterpreterInHaskell\nThis is the first successful lambda calculus interpreter I have written, and it was written in haskell.\n\n# Motivation\nI have been trying to write lambda calculus interpreters ever since I heard the concept but I always struggled with it and never got it working properly without loads of bugs but after reading through a thing on shift reduce parsing by mit I decided to give it an implementation (this was also the first time I had a proper look at a bottom up parser). After thinking about it for a while I thought that I could map the algorithm for shift reduce pretty much 1:1 on haskell's pattern matching and custom type system and so I decided to write it in haskell. After having written this I realise that this approach doesn't really work all that well but it was fun to do anyway. This motivation leads to this implementation being very bare, just because I wanted it to work and didn't want to risk any extra features just in case it didn't work.                               \n\n# Usage\ndownload all the files onto your local machine. Then compile Main.hs (I only tested compilation using ghc so it may not work on other compilers).                    \nThe input is read using the function getContents and then ran through the interpreter. to run a file through the interpreter in linux you can use the command $ cat \\[file_name] | Main  . I haven't tested this but on windows you could probably do something like $ type \\[file_name] | Main   but idk if it works.                  \n\n# Syntax\nvariables are written as one character from the alphabet, uppercase or lowercase.                   \nabstraction is written as follows: / Variable . Expression                  \nApplication has to be specified using a \\*. ie: Expression \\* Expression                  \nBrackets () exist and work in much the same way as any other infix system.                       \nThere are no comments as I couldn't be bothered.                     \n\n# important notes\nabstraction has higher precedence then application in this interpreter so /a.a\\*a will parse as (/a.a)\\*a                              \nthere is an included program (test.lc) which is an example of adding two numbers together.                     \nif there is an error in the syntax of the lambda calculus statement the program will crash with the error non-exhaustive patterns in function.                \nif you accidentally run the program without giving it a file in stdin you can enter lambda calculus through the terminal but enter will not exit the function and you need to press CTRL+d to exit the program.                       \nFor ease of lexing variable names are only one character long, this could be fairly easily changed but tbh i can't be bothered rn.                     \n\n# Compile to SKI\nI have recently added the algorithm to convert a lambda calculus statement to ski calculus. I stole this algorithm from wikipedia from https://en.wikipedia.org/wiki/Combinatory_logic. To make use of this compile MainCompile.hs rather than Main.hs . After doing this ./MainCompile will be able to be used in much the same way as ./Main Except instead of a reduced lambda calculus output it will output a string of SKI. The output of this has not been tested but it matches the examples in wikipedia (though the output of this program has far more brackets due to lack of effort in the printing function). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglubs9%2Ffirstlambdacalculusinterpreterinhaskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglubs9%2Ffirstlambdacalculusinterpreterinhaskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglubs9%2Ffirstlambdacalculusinterpreterinhaskell/lists"}