{"id":13563784,"url":"https://github.com/christhekeele/matcha","last_synced_at":"2025-04-09T17:25:52.542Z","repository":{"id":39918986,"uuid":"206191101","full_name":"christhekeele/matcha","owner":"christhekeele","description":"🍵 First-class Elixir match specifications.","archived":false,"fork":false,"pushed_at":"2024-04-19T18:29:18.000Z","size":988,"stargazers_count":87,"open_issues_count":9,"forks_count":4,"subscribers_count":5,"default_branch":"latest","last_synced_at":"2024-05-01T21:20:47.305Z","etag":null,"topics":["elixir","erlang","hex"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christhekeele.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2019-09-03T23:43:57.000Z","updated_at":"2024-06-03T01:05:00.430Z","dependencies_parsed_at":"2023-11-29T22:24:47.337Z","dependency_job_id":"4bbd9c03-5838-4f66-b403-abc8b9fcb458","html_url":"https://github.com/christhekeele/matcha","commit_stats":{"total_commits":279,"total_committers":2,"mean_commits":139.5,"dds":"0.0035842293906810374","last_synced_commit":"2ab258b55aa2867e2f880d1b9c513617e4b3e2cf"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christhekeele%2Fmatcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christhekeele%2Fmatcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christhekeele%2Fmatcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christhekeele%2Fmatcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christhekeele","download_url":"https://codeload.github.com/christhekeele/matcha/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248076008,"owners_count":21043687,"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":["elixir","erlang","hex"],"created_at":"2024-08-01T13:01:23.231Z","updated_at":"2025-04-09T17:25:52.523Z","avatar_url":"https://github.com/christhekeele.png","language":"Elixir","funding_links":[],"categories":["Macros","OTP"],"sub_categories":[],"readme":"# 🍵 Matcha\n\n\u003c!-- MODULEDOC BLURB --\u003e\n\n\u003e **_First-class match specifications for Elixir._**\n\n\u003c!-- MODULEDOC BLURB --\u003e\n\n[![Version][hex-pm-version-badge]][hex-pm-versions]\n[![Documentation][docs-badge]][docs]\n[![License][hex-pm-license-badge]][hex-pm-package]\n[![Benchmarks][benchmarks-badge]][benchmarks]\n[![Dependencies][deps-badge]][deps]\n[![Contributors][contributors-badge]][contributors]\n\n|         👍         |                  [Test Suite][suite]                  |                   [Test Coverage][coverage]                    |\n| :----------------: | :---------------------------------------------------: | :------------------------------------------------------------: |\n| [Release][release] | [![Build Status][release-suite-badge]][release-suite] | [![Coverage Status][release-coverage-badge]][release-coverage] |\n|  [Latest][latest]  |  [![Build Status][latest-suite-badge]][latest-suite]  |  [![Coverage Status][latest-coverage-badge]][latest-coverage]  |\n\n## Usage\n\n### Installation\n\n`Matcha` is distributed via [hex.pm][hex-pm], you can install it with your dependency manager of choice using the config provided on its [hex.pm package][hex-pm-package] listing.\n\n\u003c!-- MODULEDOC SNIPPET --\u003e\n\u003c!--\n  all hyperlinks in this snippet must be inline,\n  rather than using markdown link references\n--\u003e\n\n### Synopsis\n\n`Matcha` offers tight integration with Elixir and match specifications.\n\nMatch specifications are a BEAM VM feature that can execute de-structuring, pattern matching, and re-structring operations very close-to-the-metal. They can be used to efficiently:\n\n- [filter/map in-memory data](https://www.erlang.org/doc/man/ets.html#match_spec_run-2)\n- [find ETS objects](https://erlang.org/doc/man/ets.html#select-2)\n- [trace specific function calls](https://erlang.org/doc/man/dbg.html#tp-2)\n\nHowever, they are notoriously difficult to compose and use. Matcha makes this intuitive with ergonomic macros to compose them, and a high-level API with which to use them.\n\n### Examples\n\n```elixir\n# Turn Elixir code into a match specification,\n#  then use it to filter/map some data\niex\u003e require Matcha\n...\u003e Matcha.spec do\n...\u003e   {x, y, z} -\u003e x + y + z\n...\u003e end\n...\u003e |\u003e Matcha.Spec.run!([\n...\u003e   {1, 2, 3},\n...\u003e   {1, 2},\n...\u003e   {1, 2, 3, 4},\n...\u003e   {4, 5, 6}\n...\u003e ])\n[6, 15]\n```\n\nThis is one way to run test and develop match specifications, but they truly shine in table and tracing applications!\n\n### Guides\n\nCheck out [the interactive usage guides](https://hexdocs.pm/matcha/guide-usage.html#content), including using Matcha for:\n\n- [filtering \u0026 mapping data](https://hexdocs.pm/matcha/guide-filtering-and-mapping.html#content)\n- [selecting objects from tables](https://hexdocs.pm/matcha/guide-tables.html#content)\n- [tracing function calls](https://hexdocs.pm/matcha/guide-tracing.html#content)\n\n\u003c!-- MODULEDOC SNIPPET --\u003e\n\n### Documentation\n\nComplete documentation, including guides, are hosted online on [hexdocs.pm][docs].\n\n## Contributing\n\nContributions are welcome! Check out the [contributing guide][contributing] for more information, and suggestions on where to start.\n\n## Supported Versions\n\nMatcha strives to support the most recent three versions of Elixir and the Erlang/OTPs they support. The canonical list of supported combinations is available by checking the latest successful [test matrix run][test-matrix], but boils down to:\n\n- Elixir 1.14.x\n  - OTP 23.x\n  - OTP 24.x\n  - OTP 25.x\n- Elixir 1.15.x\n  - OTP 24.x\n  - OTP 25.x\n  - OTP 26.x\n\nEarlier versions of Elixir tend to work well, **_provided you polyfill [Elixir 1.14.0's `PartitionSupervisor`](https://hexdocs.pm/elixir/PartitionSupervisor.html)_**, back to Elixir 1.10, but the test suite often uses newer syntax that is complicated to circumvent when testing on older versions (ex. range step literals), so we don't officially commit to being compatible with them since they are not a part of the suite. Versions that may work include:\n\n- Elixir 1.10.x\n  - OTP 21.x\n  - OTP 22.x\n  - OTP 23.x\n- Elixir 1.11.x\n  - OTP 21.x\n  - OTP 22.x\n  - OTP 23.x\n  - OTP 24.x\n- Elixir 1.12.x\n  - OTP 22.x\n  - OTP 23.x\n  - OTP 24.x\n- Elixir 1.13.x\n  - OTP 22.x\n  - OTP 23.x\n  - OTP 24.x\n  - OTP 25.x\n\nSince `Matcha` pokes around in compiler internals, it is important to get ahead of upcoming changes to the language.\nThis is accomplished with [nightly builds][test-edge] against the latest versions of Elixir, Erlang/OTP, and dependencies;\nwhich catches issues like [internal compiler function signature changes](https://github.com/christhekeele/matcha/commit/27f3f34284349d807fcd2817a04cb4628498a7eb#diff-daf93cf4dc6034e9862d0d844c783586210ea822ae6ded51d925b0ac9e09766bR31-R43)\nwell in advance of release.\n\n\u003c!-- LINKS \u0026 IMAGES --\u003e\n\n\u003c!-- Hex --\u003e\n\n[hex-pm]: https://hex.pm\n[hex-pm-package]: https://hex.pm/packages/matcha\n[hex-pm-versions]: https://hex.pm/packages/matcha/versions\n[hex-pm-version-badge]: https://img.shields.io/hexpm/v/matcha.svg?cacheSeconds=86400\u0026style=flat-square\n[hex-pm-downloads-badge]: https://img.shields.io/hexpm/dt/matcha.svg?cacheSeconds=86400\u0026style=flat-square\n[hex-pm-license-badge]: https://img.shields.io/badge/license-MIT-7D26CD.svg?cacheSeconds=86400\u0026style=flat-square\n\n\u003c!-- Docs --\u003e\n\n[docs]: https://hexdocs.pm/matcha/index.html\n[docs-guides]: https://hexdocs.pm/matcha/usage.html#content\n[docs-badge]: https://img.shields.io/badge/documentation-online-purple?cacheSeconds=86400\u0026style=flat-square\n\n\u003c!-- Deps --\u003e\n\n[deps]: https://hex.pm/packages/matcha\n[deps-badge]: https://img.shields.io/badge/dependencies-0-blue?cacheSeconds=86400\u0026style=flat-square\n\n\u003c!-- Benchmarks --\u003e\n\n[benchmarks]: https://christhekeele.github.io/matcha/bench\n[benchmarks-badge]: https://img.shields.io/badge/benchmarks-online-2ab8b5?cacheSeconds=86400\u0026style=flat-square\n\n\u003c!-- Contributors --\u003e\n\n[contributors]: https://hexdocs.pm/matcha/contributors.html\n[contributors-badge]: https://img.shields.io/badge/contributors-%F0%9F%92%9C-lightgrey\n\n\u003c!-- Status --\u003e\n\n[suite]: https://github.com/christhekeele/matcha/actions?query=workflow%3A%22Test+Suite%22\n[coverage]: https://coveralls.io/github/christhekeele/matcha\n\n\u003c!-- Release Status --\u003e\n\n[release]: https://github.com/christhekeele/matcha/tree/release\n[release-suite]: https://github.com/christhekeele/matcha/actions?query=workflow%3A%22Test+Suite%22+branch%3Arelease\n[release-suite-badge]: https://img.shields.io/github/actions/workflow/status/christhekeele/matcha/test-suite.yml?branch=release\u0026cacheSeconds=86400\u0026style=flat-square\n[release-coverage]: https://coveralls.io/github/christhekeele/matcha?branch=release\n[release-coverage-badge]: https://img.shields.io/coverallsCoverage/github/christhekeele/matcha?branch=release\u0026cacheSeconds=86400\u0026style=flat-square\n\n\u003c!-- Latest Status --\u003e\n\n[latest]: https://github.com/christhekeele/matcha/tree/latest\n[latest-suite]: https://github.com/christhekeele/matcha/actions?query=workflow%3A%22Test+Suite%22+branch%3Alatest\n[latest-suite-badge]: https://img.shields.io/github/actions/workflow/status/christhekeele/matcha/test-suite.yml?branch=latest\u0026cacheSeconds=86400\u0026style=flat-square\n[latest-coverage]: https://coveralls.io/github/christhekeele/matcha?branch=latest\n[latest-coverage-badge]: https://img.shields.io/coverallsCoverage/github/christhekeele/matcha?branch=latest\u0026cacheSeconds=86400\u0026style=flat-square\n\n\u003c!-- Other --\u003e\n\n[changelog]: https://hexdocs.pm/matcha/changelog.html\n[test-matrix]: https://github.com/christhekeele/matcha/actions/workflows/test-matrix.yml\n[test-edge]: https://github.com/christhekeele/matcha/actions/workflows/test-edge.yml\n[contributing]: https://hexdocs.pm/matcha/contributing.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristhekeele%2Fmatcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristhekeele%2Fmatcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristhekeele%2Fmatcha/lists"}