{"id":37019787,"url":"https://github.com/scytrowski/mat","last_synced_at":"2026-01-14T02:12:42.471Z","repository":{"id":302726649,"uuid":"1009909188","full_name":"scytrowski/mat","owner":"scytrowski","description":"Lightweight Scala 3 library for materializing types into values at compile time.","archived":false,"fork":false,"pushed_at":"2025-07-03T22:16:14.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-03T23:25:13.486Z","etag":null,"topics":["compiletime","scala","scala3","typelevel","typelevel-programming"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/scytrowski.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-28T00:03:00.000Z","updated_at":"2025-07-03T22:16:18.000Z","dependencies_parsed_at":"2025-07-03T23:25:19.885Z","dependency_job_id":"9a364759-cfb2-41c2-9664-31930084b26f","html_url":"https://github.com/scytrowski/mat","commit_stats":null,"previous_names":["scytrowski/mat"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/scytrowski/mat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scytrowski%2Fmat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scytrowski%2Fmat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scytrowski%2Fmat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scytrowski%2Fmat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scytrowski","download_url":"https://codeload.github.com/scytrowski/mat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scytrowski%2Fmat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["compiletime","scala","scala3","typelevel","typelevel-programming"],"created_at":"2026-01-14T02:12:41.992Z","updated_at":"2026-01-14T02:12:42.461Z","avatar_url":"https://github.com/scytrowski.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mat\n\n[![Scala](https://img.shields.io/badge/Scala-3.7.3-red.svg)](https://www.scala-lang.org)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.scytrowski/mat_3)](https://mvnrepository.com/artifact/io.github.scytrowski/mat_3)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n**`mat`** is a lightweight Scala 3 library for materializing types into values at compile time.\n\nIt provides a typeclass-based approach for turning types like tuples, literal types, or case classes into values using `inline` and `Mirror`.\n\n---\n\n## ✨ Features\n\n- Materialize literal types like `5`, `\"hello\"`, `true`\n- Recursively materialize tuples: `(1, \"abc\", true)`\n- Materialize case classes via `Mirror.ProductOf`\n- Materialize singleton sealed trait based ADTs via `Mirror.SumOf`\n- Safe fallback with `materializeOpt[A]` returning `Option`\n\n---\n\n## 📦 Examples\n\n### Materialize a literal value\n\n```scala\nimport io.github.scytrowski.mat.*\n\nval x: 42 = materialize[42]\n// x: 42\n```\n\n### Materialize a tuple\n\n```scala\nimport io.github.scytrowski.mat.*\n\nval x: (true, 'd', \"abc\") = materialize[(true, 'd', \"abc\")]\n// x: (true, 'd', \"abc\")\n```\n\n### Materialize a case object\n\n```scala\nimport io.github.scytrowski.mat.*\n\ncase object SomeObject\n\nval x: SomeObject.type = materialize[SomeObject.type]\n// x: SomeObject\n```\n\n### Materialize a case class\n\n```scala\nimport io.github.scytrowski.mat.*\n\ncase class SomeClass[A](a: A)\n\nval x: SomeClass[15] = materialize[SomeClass[15]]\n// x: SomeClass(15)\n```\n\n### Materialize a singleton ADT variant\n\n```scala\nimport io.github.scytrowski.mat.*\n\nsealed trait SomeADT\n\ncase object SingletonVariant extends SomeADT\n\nval x: SingletonVariant.type = materialize[SomeADT]\n// x: SingletonVariant\n```\n\n### Provide custom materialization logic\n\n```scala\nimport io.github.scytrowski.mat.*\n\nsealed abstract class SomeClass\n\nobject SomeClass:\n  val instance: SomeClass = new SomeClass {}\n\ngiven CustomMaterialize[SomeClass]:\n  override type Out = SomeClass\n  override def apply(): SomeClass = SomeClass.instance\n\nval x: SomeClass = materialize[SomeClass]\n// x: SomeClass.instance\n```\n\n### Require a materializable type\n\n```scala\nimport io.github.scytrowski.mat.*\n\ndef doSomethingWithMaterializableType[A: Materialize] = ???\n```\n\n---\n\n## 🚧 TODO\n\n- [ ] Support intersection types - e.g.: `5 \u0026 Int` should materialize as `5`\n- [ ] Support union types - e.g.: `5 | String` should materialize as `5`\n- [ ] Support nested singleton ADTs\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nYou are free to use, copy, modify, and distribute it with attribution.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscytrowski%2Fmat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscytrowski%2Fmat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscytrowski%2Fmat/lists"}