{"id":17237786,"url":"https://github.com/tarao/lambda-scala","last_synced_at":"2025-07-05T18:06:28.979Z","repository":{"id":31514340,"uuid":"35078716","full_name":"tarao/lambda-scala","owner":"tarao","description":"Type level lambda calculus in Scala","archived":false,"fork":false,"pushed_at":"2015-05-05T04:54:21.000Z","size":100,"stargazers_count":33,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T16:55:53.769Z","etag":null,"topics":["lambda-calculus","scala","typelevel"],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/tarao.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":"2015-05-05T04:53:57.000Z","updated_at":"2021-05-01T12:06:47.000Z","dependencies_parsed_at":"2022-09-09T10:21:41.374Z","dependency_job_id":null,"html_url":"https://github.com/tarao/lambda-scala","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/tarao%2Flambda-scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarao%2Flambda-scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarao%2Flambda-scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarao%2Flambda-scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarao","download_url":"https://codeload.github.com/tarao/lambda-scala/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813827,"owners_count":21165631,"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":["lambda-calculus","scala","typelevel"],"created_at":"2024-10-15T05:43:45.494Z","updated_at":"2025-04-14T02:52:18.095Z","avatar_url":"https://github.com/tarao.png","language":"Scala","readme":"Type level lambda calculus in Scala\n===================================\n\nThis repository demonstrates an implementation of lambda calculus in\nScala types.\n\nUntyped lambda calculus\n-----------------------\n\n```scala\nimport lambda._\ncase class Equals[A \u003e: B \u003c: B, B]() // this checks type equality\n\ntype S = x -\u003e: y -\u003e: z -\u003e: ( x @@ z @@ (y @@ z) )\ntype K = x -\u003e: y -\u003e: x\n\ntype result = ( S @@ K @@ K @@ a ) # -\u003e*\nEquals[result, a]\n```\n\nMore examples are found in [TermSpec.scala][example].\n\n### Syntax\n\n|                         |Code              |\n|:------------------------|:-----------------|\n|Variables                |`a`, `b`, ..., `z`|\n|Abstraction              |`v -\u003e: M`         |\n|Application              |`M @@ N`          |\n|Terms                    |`M`, `N`          |\n|1-step beta reduction    |`M # -\u003e`          |\n|Multi-step beta reduction|`M # -\u003e*`         |\n\n- You can define your own variables by calling `#next` of existing (last defined) variable\n\n  ```scala\n  type variableName1 = z #next\n  type variableName2 = variableName1 #next\n  ```\n\n- You may need parenthesis to avoid ambiguity\n\n### Capture-avoiding substitutions\n\nLambda terms are converted internally to\n[De Bruijn indexed terms][debruijn] and indices are shifted during\nsubstitution to ensure capture-avoiding semantics.\n\nLicense\n-------\n\n- Copyright (C) INA Lintaro\n- MIT License\n\nReferences\n----------\n\n- [Scala type level encoding of the SKI calculus][ski]\n- [Type-Level Programming in Scala][typelevel]\n\n[example]: src/test/scala/lambda/TermSpec.scala\n[debruijn]: http://en.wikipedia.org/wiki/De_Bruijn_index\n[ski]: https://michid.wordpress.com/2010/01/29/scala-type-level-encoding-of-the-ski-calculus/\n[typelevel]: https://apocalisp.wordpress.com/2010/06/08/type-level-programming-in-scala/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarao%2Flambda-scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarao%2Flambda-scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarao%2Flambda-scala/lists"}