{"id":24394394,"url":"https://github.com/cu1ch3n/type-inference-zoo","last_synced_at":"2025-04-11T13:43:48.841Z","repository":{"id":271206750,"uuid":"908907304","full_name":"cu1ch3n/type-inference-zoo","owner":"cu1ch3n","description":"🦖 Implementations of various type inference algorithms. Online interactive playground is available at https://zoo.cuichen.cc/","archived":false,"fork":false,"pushed_at":"2025-04-06T11:29:45.000Z","size":224,"stargazers_count":25,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T12:17:41.998Z","etag":null,"topics":["functional-programming","haskell","programming-languages","type-inference","zoo"],"latest_commit_sha":null,"homepage":"https://zoo.cuichen.cc/","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/cu1ch3n.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":"2024-12-27T09:05:39.000Z","updated_at":"2025-04-06T11:29:48.000Z","dependencies_parsed_at":"2025-01-06T09:36:43.100Z","dependency_job_id":"26d89a9f-e537-4e77-ad48-bd242c544cf6","html_url":"https://github.com/cu1ch3n/type-inference-zoo","commit_stats":null,"previous_names":["cu1ch3n/type-inference-zoo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cu1ch3n%2Ftype-inference-zoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cu1ch3n%2Ftype-inference-zoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cu1ch3n%2Ftype-inference-zoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cu1ch3n%2Ftype-inference-zoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cu1ch3n","download_url":"https://codeload.github.com/cu1ch3n/type-inference-zoo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410877,"owners_count":21098789,"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":["functional-programming","haskell","programming-languages","type-inference","zoo"],"created_at":"2025-01-19T19:24:09.873Z","updated_at":"2025-04-11T13:43:48.822Z","avatar_url":"https://github.com/cu1ch3n.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Type Inference Zoo\n\n![Build Status](https://github.com/cu1ch3n/type-inference-zoo/actions/workflows/build.yml/badge.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n\n\nWelcome to **Type Inference Zoo**! This project is dedicated to implementing a variety of type inference algorithms. It serves as a personal project, as I am trying to understand the type inference algorithms well by implmenting them. Considering that it might be helpful for those who are also exploring type inference algoreithms, I am glad to make them avaliable online.\n\n🗿🗿🗿 There are indeed animals (**implementations**) in the zoo, not only references to animals.\n\nA static online web demo is available for you to try at https://zoo.cuichen.cc/.\n\n## 🚀 Get Started\n\nTo get started with the project, clone the repository and build the project using [`stack`](https://docs.haskellstack.org/):\n\n```bash\ngit clone https://github.com/cu1ch3n/type-inference-zoo.git\ncd type-inference-zoo\nstack build\nstack exec type-inference-zoo-exe -- \"let id = \\x. x in (id 1, id True)\" --alg W\n```\n\n## Research Works Implemented\n\n- [x] `W`: [`./src/Alg/HDM/AlgW.hs`](./src/Alg/HDM/AlgW.hs)\n  - *Robin Milner.* **A Theory of Type Polymorphism in Programming.** Journal of Computer and System Sciences, 1978.\n    [[Paper](https://www.sciencedirect.com/science/article/pii/0022000078900144)]\n- [x] `DK`: [`./src/Alg/DK/DK.hs`](./src/Alg/DK/DK.hs)\n  - *Jana Dunfield and Neelakantan R. Krishnaswami.* **Complete and Easy Bidirectional Typechecking for Higher-rank Polymorphism.** ICFP 2013. \n    [[Paper](https://dl.acm.org/doi/10.1145/2500365.2500582)]\n- [x] `Worklist`: [`./src/Alg/DK/Worklist/DK.hs`](./src/Alg/DK/Worklist/DK.hs)\n  - *Jinxu Zhao, Bruno C. d. S. Oliveira, and Tom Schrijvers.* **A Mechanical Formalization of Higher-Ranked Polymorphic Type Inference.** ICFP 2019.\n    [[Paper](https://dl.acm.org/doi/10.1145/3341716)]\n- [x] `Elementary`: [`./src/Alg/DK/Worklist/Elementary.hs`](./src/Alg/DK/Worklist/Elementary.hs)\n  - *Jinxu Zhao and Bruno C. d. S. Oliveira.* **Elementary Type Inference.** ECOOP 2022.\n    [[Paper](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ECOOP.2022.2)]\n- [x] `R`: [`./src/Alg/HDM/AlgR.hs`](./src/Alg/HDM/AlgR.hs)\n  - *Roger Bosman, Georgios Karachalias, Tom Schrijvers.* **No Unification Variable Left Behind: Fully Grounding Type Inference for the HDM System.** ITP 2023.\n    [[Paper](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ITP.2023.8)]\n- [x] `Bounded`: [`./src/Alg/DK/Worklist/Bounded.hs`](./src/Alg/DK/Worklist/Bounded.hs)\n  - *Chen Cui, Shengyi Jiang, and Bruno C. d. S. Oliveira.* **Greedy Implicit Bounded Quantification.** OOPSLA 2023.\n    [[Paper](https://dl.acm.org/doi/10.1145/3622871)]\n- [x] `Contextual`: [`./src/Alg/Local/Contextual/Contextual.hs`](./src/Alg/Local/Contextual/Contextual.hs)\n  - *Xu Xue and Bruno C. d. S. Oliveira.* **Contextual Typing.** ICFP 2024.\n    [[Paper](https://dl.acm.org/doi/10.1145/3674655)]\n- [x] `IU`: [`./src/Alg/DK/Worklist/IU.hs`](./src/Alg/DK/Worklist/IU.hs)\n  - *Shengyi Jiang, Chen Cui and Bruno C. d. S. Oliveira.* **Bidirectional Higher-Rank Polymorphism with Intersection and Union Types.** POPL 2025.\n    [[Paper](https://i.cs.hku.hk/~bruno/papers/popl25_hrp.pdf)]\n\n## Contribution\n\nContributions are welcome! If you're interested in improving this project, please feel free to open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Disclaim\n\nThis project is still in its early stages, and I am not an expert in either type inference or Haskell :) Please use it at your own risk (Some of the code was assisted by GitHub Copilot or ChatGPT). If you spot any issues or have suggestions, please open an issue to help improve the project.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcu1ch3n%2Ftype-inference-zoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcu1ch3n%2Ftype-inference-zoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcu1ch3n%2Ftype-inference-zoo/lists"}