{"id":13838012,"url":"https://github.com/andreypopp/type-systems","last_synced_at":"2026-04-06T01:31:33.387Z","repository":{"id":46061177,"uuid":"417605921","full_name":"andreypopp/type-systems","owner":"andreypopp","description":"Playing with type systems","archived":false,"fork":false,"pushed_at":"2024-12-29T19:36:39.000Z","size":204,"stargazers_count":51,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-03T05:57:28.808Z","etag":null,"topics":["hindley-milner","ocaml","type-inference","type-systems","typeclasses"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/andreypopp.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":"2021-10-15T18:59:35.000Z","updated_at":"2025-05-31T23:25:02.000Z","dependencies_parsed_at":"2025-01-15T14:38:53.388Z","dependency_job_id":"6ddfc60f-1267-4ac5-ae39-8049c44c59f0","html_url":"https://github.com/andreypopp/type-systems","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"9d42ed5e7c0f455cff4f497182a65815b56344db"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andreypopp/type-systems","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypopp%2Ftype-systems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypopp%2Ftype-systems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypopp%2Ftype-systems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypopp%2Ftype-systems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreypopp","download_url":"https://codeload.github.com/andreypopp/type-systems/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypopp%2Ftype-systems/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31456594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"ssl_error","status_checked_at":"2026-04-05T21:22:51.943Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["hindley-milner","ocaml","type-inference","type-systems","typeclasses"],"created_at":"2024-08-04T15:01:33.418Z","updated_at":"2026-04-06T01:31:33.371Z","avatar_url":"https://github.com/andreypopp.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# type-systems\n\n- `algo_w` - Algorithm W extended with \"Extensible Records with Scoped Labels\"\n  and Multi Parameter Typeclasses.\n\n  This follows closely [tomprimozic/type-systems] and then [THIH][] (Typing\n  Haskell in Haskell). Note that this tries to support multi-parameter typeclasses\n  (MPTC) but generalization is currently buggy for typeclasses with multiple parameters.\n  See `hmx_tc` implementation for the bug-free HM + MPTC implementation.\n\n- `hmx` - [HM(X)][] style implementation of Hindley Minler type inference.\n\n  The main idea is to introduce constraint language and split the algo into two\n  phases — first generate constraints from terms, then solve those constraints.\n\n  This implementation also does elaboration, the `infer` function has the\n  following signature:\n  ```\n  val infer : env:Env.t -\u003e expr -\u003e (expr, Error.t) result\n  ```\n  That means that `infer` returns not just the type of the expression but an\n  elaborated expression (an original expression annotated with types).\n\n  The elaboration mechanism is shamelessly stolen from [inferno][].\n\n- `hmx_tc` - extends [HM(X)][] with Multi-Parameter Typeclasses (MPTC).\n  \n  Type inference and elaborator are implemented but the environment construction\n  doesn't check for overlapping instances yet.\n\n# Development\n\n```\nmake init\nmake build\nmake test\n```\n\n# References\n\n- https://en.wikipedia.org/wiki/Hindley–Milner_type_system\n- https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/scopedlabels.pdf\n- https://www.cs.tufts.edu/~nr/cs257/archive/martin-odersky/hmx.pdf\n- https://web.cecs.pdx.edu/~mpj/thih/thih.pdf\n- https://github.com/tomprimozic/type-systems\n- https://gitlab.inria.fr/fpottier/inferno/\n- https://github.com/naominitel/hmx\n\n[HM(X)]: https://www.cs.tufts.edu/~nr/cs257/archive/martin-odersky/hmx.pdf\n[inferno]: https://gitlab.inria.fr/fpottier/inferno/\n[THIH]: https://web.cecs.pdx.edu/~mpj/thih/thih.pdf\n[tomprimozic/type-systems]: https://github.com/tomprimozic/type-systems\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreypopp%2Ftype-systems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreypopp%2Ftype-systems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreypopp%2Ftype-systems/lists"}