{"id":25588693,"url":"https://github.com/nyrox/mark-language","last_synced_at":"2026-07-01T00:31:12.897Z","repository":{"id":140802255,"uuid":"312777681","full_name":"Nyrox/mark-language","owner":"Nyrox","description":"ML Dialect with Bi-Directional Type Checking (extended HM), Generics and some other cool stuff","archived":false,"fork":false,"pushed_at":"2025-08-29T09:29:21.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-11T00:03:01.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/Nyrox.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-11-14T08:37:44.000Z","updated_at":"2025-03-31T01:05:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"03635edd-d926-4ef7-82ab-b2f42010e560","html_url":"https://github.com/Nyrox/mark-language","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nyrox/mark-language","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nyrox%2Fmark-language","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nyrox%2Fmark-language/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nyrox%2Fmark-language/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nyrox%2Fmark-language/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nyrox","download_url":"https://codeload.github.com/Nyrox/mark-language/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nyrox%2Fmark-language/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34988712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"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":"2025-02-21T08:50:09.151Z","updated_at":"2026-07-01T00:31:12.872Z","avatar_url":"https://github.com/Nyrox.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mark's ML Dialect, ML for short.\n\nA small ML dialect to test ideas. Experimenting with advanced type systems, featuring Closed type classes, i.e. type classes whose members are known at declaration time to allow for exhaustive pattern matching.\n\nCheck the examples/ folder for some real code.\n\nFeatures:\n- [x] Bi-Directional Type Checker allowing for large scale inference just from top-level annotation\n- [x] Closed Type Classes\n- [x] Variant Polymorphism, allowing closed type classes to declare multiple variants and conditionally compile types and methods based on those variants\n- [x] Functions as first-class objects\n- [x] Partial Function Application and Currying\n- [x] Full algebraic data types, including pattern matching on union types\n- [x] Simple and mutual function recursion\n- [x] Recursive data types\n\nPlanned:\n\n- [ ] Pattern Matching closed type classes\n- [ ] Simple generic type constructors\n\nMaybe Planned:\n\n- [ ] Generic Functors aka. Module Generics á la Ocaml\n- [ ] Refinement Types\n\n\n\n\nCurrent progress: This program **runs**\n\n```ml\ntype Row =\n\t| Cons of (Bool, Row)\n\t| Nil\n\ntype Map =\n\t| Cons of (Row, Map)\n\t| Nil\n\n\nparse_row :: String -\u003e Row\nparse_row input =\n\tif input == \"\" then\n\t\tRow.Nil\n\telse\n\t\tlet split = String_get_first input\n\t\tRow.Cons (split.0 == \"#\", parse_row split.1)\n\nparse :: String -\u003e Map\nparse input =\n\tif input == \"\" then\n\t\tMap.Nil\n\telse\n\t\tlet split = String_split (input, \"\\r\\n\")\n\t\tMap.Cons (parse_row split.0, parse split.1)\n\n\nrow_len :: Row -\u003e Int\nrow_len row =\n\tmatch row with\n\t| Cons m -\u003e row_len m.1 + 1\n\t| Nil -\u003e 0\n\n\nget_nth_elem :: Row -\u003e Int -\u003e Bool\nget_nth_elem row n =\n\tmatch row with\n\t| Cons r -\u003e\n\t\tif n == 0 then\n\t\t\tr.0\n\t\telse\n\t\t\tget_nth_elem r.1 (n - 1)\n\nhas_tree :: Row -\u003e Int -\u003e Bool\nhas_tree row xpos =\n\tlet len = row_len row\n\tget_nth_elem row (xpos % len)\n\n\ntype Slope = (Int, Int)\n\n\ntraverse_map_inner :: Map -\u003e Slope -\u003e Int -\u003e Int -\u003e Int\ntraverse_map_inner map slope xpos ypos =\n\tmatch map with\n\t| Cons m -\u003e\n\t\tif ypos % slope.1 == 0 then\n\t\t\tlet rest = traverse_map_inner m.1 slope (xpos + slope.0) (ypos + 1)\n\t\t\tif has_tree m.0 xpos then\n\t\t\t\t1 + rest\n\t\t\telse\n\t\t\t\trest\n\t\telse\n\t\t\t// skip rows that are not described by the slope\n\t\t\ttraverse_map_inner m.1 slope xpos (ypos + 1)\n\t| Nil -\u003e\n\t\t0 // we are done\n\ntraverse_map :: Map -\u003e Slope -\u003e Int\ntraverse_map map slope =\n\ttraverse_map_inner map slope 0 0\n\nmain () =\n\tlet input = File_read \"./input\"\n\tlet map = parse input\n\n\tlet results = (\n\t\ttraverse_map map (1, 1),\n\t\ttraverse_map map (3, 1),\n\t\ttraverse_map map (5, 1),\n\t\ttraverse_map map (7, 1),\n\t\ttraverse_map map (1, 2)\n\t)\n\n\tresults.0 * results.1 * results.2 * results.3 * results.4\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnyrox%2Fmark-language","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnyrox%2Fmark-language","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnyrox%2Fmark-language/lists"}