{"id":28828691,"url":"https://github.com/jakobknauer/hindley-milner","last_synced_at":"2025-07-27T21:36:09.336Z","repository":{"id":299092286,"uuid":"1001062840","full_name":"jakobknauer/hindley-milner","owner":"jakobknauer","description":"An implementation of Algorithm J for type inference in the Hindley-Milner type system, written in Rust","archived":false,"fork":false,"pushed_at":"2025-06-14T16:21:44.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-14T16:45:04.543Z","etag":null,"topics":["algorithm-j","hindley-milner","type-inference"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jakobknauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2025-06-12T18:56:55.000Z","updated_at":"2025-06-14T16:21:47.000Z","dependencies_parsed_at":"2025-06-14T16:45:06.728Z","dependency_job_id":"8ed8ebef-1399-46c9-95a9-43ec00d65c1c","html_url":"https://github.com/jakobknauer/hindley-milner","commit_stats":null,"previous_names":["jakobknauer/hindley-milner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jakobknauer/hindley-milner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobknauer%2Fhindley-milner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobknauer%2Fhindley-milner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobknauer%2Fhindley-milner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobknauer%2Fhindley-milner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakobknauer","download_url":"https://codeload.github.com/jakobknauer/hindley-milner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakobknauer%2Fhindley-milner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260690915,"owners_count":23047101,"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":["algorithm-j","hindley-milner","type-inference"],"created_at":"2025-06-19T05:09:08.212Z","updated_at":"2025-07-27T21:36:09.329Z","avatar_url":"https://github.com/jakobknauer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"A Rust implementation of [Algorithm J](https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system#Algorithm_J) for type inference in the [Hindley-Milner type system](https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system).\n\nFurthermore, the repo includes:\n- a parser for expressions and types,\n- an equality check for types that respects renaming of bound variables,\n- unit tests for the parser and the inference algorithm, and\n- a REPL for inferring types of user-provided expressions (on empty context; for examples with non-empty context, see the unit tests in [src/algorithm_j.rs](src/algorithm_j.rs)).\n\nRun the program to try out the REPL:\n```\ncargo run\n...\n\u003e\u003e\u003e lambda x . x\n⊢ λx . x : ∀ _1 . _1 → _1\n\u003e\u003e\u003e lambda f . lambda x . f x\n⊢ λf . λx . f x : ∀ _3 _2 . (_2 → _3) → _2 → _3\n\u003e\u003e\u003e lambda f . lambda x . f (f x)\n⊢ λf . λx . f (f x) : ∀ _4 . (_4 → _4) → _4 → _4\n```\n\nCaveats:\n- The parser accepts the ASCII alternatives `lambda` for `λ`, `forall` for `∀`, and `to` for `→`.\n- The parser only accepts alphanumeric identifiers starting with a letter.\n- When parsing types, the parser interprets identifiers starting with a small letter as type variables, and identifiers starting with a capital letter as type constructors.\n- As seen in the example above, fresh variables generated during inference are of the form `_1`, `_2`, etc., and thus cannot collide with parsed variables.\n- The notation (identifiers in the code etc.) as well as the algorithm itself closely follow the description on Wikipedia.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakobknauer%2Fhindley-milner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakobknauer%2Fhindley-milner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakobknauer%2Fhindley-milner/lists"}