{"id":15882643,"url":"https://github.com/tcr/corollary","last_synced_at":"2025-09-07T14:31:51.020Z","repository":{"id":57653173,"uuid":"90224991","full_name":"tcr/corollary","owner":"tcr","description":"Cross-compiler from Haskell to Rust, plus parser-haskell.","archived":false,"fork":false,"pushed_at":"2017-07-22T19:12:48.000Z","size":4198,"stargazers_count":78,"open_issues_count":25,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-04T05:27:30.600Z","etag":null,"topics":["corollary","cross-compiler","haskell","parsing-library","rust"],"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/tcr.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":"2017-05-04T05:29:07.000Z","updated_at":"2025-07-29T17:43:53.000Z","dependencies_parsed_at":"2022-09-01T01:20:31.726Z","dependency_job_id":null,"html_url":"https://github.com/tcr/corollary","commit_stats":null,"previous_names":["tcr/corrode-but-in-rust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tcr/corollary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcorollary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcorollary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcorollary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcorollary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcr","download_url":"https://codeload.github.com/tcr/corollary/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcorollary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273933933,"owners_count":25193602,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"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":["corollary","cross-compiler","haskell","parsing-library","rust"],"created_at":"2024-10-06T04:05:59.589Z","updated_at":"2025-09-07T14:31:50.713Z","avatar_url":"https://github.com/tcr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Corollary: Haskell to Rust conversion\n\n[![https://img.shields.io/crates/v/corollary.svg](https://img.shields.io/crates/v/corollary.svg)](http://crates.io/crates/corollary)\n\nCorollary is a very experimental Haskell to Rust compiler. The goal is to automate the syntatic conversion of Haskell into Rust, letting users manually finish the conversion into idiomatic Rust code. Along with an (extremely loose) adaptation of Haskell methods in `corollary-support`, this can expediate the process of completing a full port.\n\n**Current status: Looking for maintainers.** Corollary can parse and translate entire files, with varying results. Source code specific hacks, along with manual translation, were used for the [language-c](http://github.com/tcr/parser-c) port of Haskell's C parsing library.\n\nGiven this project was purpose-built for porting a single library, you'll find source-specific hacks throughout the codebase, though they should ultimately be removed. There are no solutions yet for the following problems:\n\n* Haskell's module and import system\n* Haskell's garbage collection (instead, given Haskell values are immutable, we liberally .clone() most values when passed around instead)\n* Top-level functions without explicit type declarations\n* Monads and HKT\n* Tail recursion\n* True laziness\n* Or currying (lacking a better way to involve Haskell's type analysis).\n\n## Usage\n\nCorollary can be used as a binary:\n\n```\ncargo install corollary\ncorollary input/file/path.hs -o target/output.rs\n```\n\nThsi converts a single source file from Haskell into Rust. You can omit the `-o` parameter to write the file to stdout. Additionally, you can run a file using the `--run` parameter.\n\nCorollary will strip any code in a `{-HASKELL-} ... {-/HASKELL-}` block and include any code in a `{-RUST ... /RUST-}` block embedded in a file. (See `corollary/test` for examples.) This allows you to `--run` a Haskell file directly, given it is self-contained (does not rely on Haskell's module system).\n\n## Development\n\nClone this repository including its test dependencies:\n\n```\ngit clone http://github.com/tcr/corollary --recursive\n```\n\nThese are the crates contained in this repo:\n\n* **`parser-haskell/`**, an original Haskell Parser written in LALRPOP.\n* **`corollary/`**, an experimental Haskell to Rust compiler.\n* **`corollary-support/`**, a support crate for converted Haskell code to use.\n\nIn addition, libraries to test Corollary against exist in the `deps/` directory.\n\n## References\n\n* [Ten Things You Should Know About Haskell Syntax](https://www.fpcomplete.com/blog/2012/09/ten-things-you-should-know-about-haskell-syntax)\n* [Haskell: The Confusing Parts](http://echo.rsmw.net/n00bfaq.html)\n\n## License\n\nCorollary and `parser-haskell` are licensed as MIT or Apache-2, at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcr%2Fcorollary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcr%2Fcorollary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcr%2Fcorollary/lists"}