{"id":16726876,"url":"https://github.com/lpil/total","last_synced_at":"2025-10-23T15:55:43.683Z","repository":{"id":62430483,"uuid":"193392688","full_name":"lpil/total","owner":"lpil","description":"Basic exhaustiveness checking of unions in Elixir","archived":false,"fork":false,"pushed_at":"2019-06-23T20:31:14.000Z","size":7,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T09:21:09.568Z","etag":null,"topics":["elixir-lang","exhaustiveness-checking","macros"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lpil.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":"2019-06-23T20:30:40.000Z","updated_at":"2023-11-10T18:14:07.000Z","dependencies_parsed_at":"2022-11-01T20:21:38.754Z","dependency_job_id":null,"html_url":"https://github.com/lpil/total","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Ftotal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Ftotal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Ftotal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Ftotal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpil","download_url":"https://codeload.github.com/lpil/total/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199136,"owners_count":21063641,"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-lang","exhaustiveness-checking","macros"],"created_at":"2024-10-12T22:54:54.109Z","updated_at":"2025-10-23T15:55:38.632Z","avatar_url":"https://github.com/lpil.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Total\n\nSimple exhaustiveness checking of tuple + atom based unions.\n\n```elixir\ndefmodule MyType do\n  require Total\n\n  # define a union\n  Total.defunion(method() :: :get | :post | {:other, term()})\nend\n\ndefmodule Elsewhere do\n  require MyType\n\n  # This is OK, all variants are covered\n  def method_string(m) do\n    MyType.method_case m do\n      :get -\u003e \"GET\"\n      :post -\u003e \"POST\"\n      {:other, t} -\u003e t\n    end\n  end\n\n  # This is a compile time error: missing `{:other, term()}`\n  def method_string(m) do\n    MyType.method_case m do\n      :get -\u003e \"GET\"\n      :post -\u003e \"POST\"\n    end\n  end\nend\n```\n\nThe exhaustiness checking is very basic: bare atoms are checked and tuples\nhave their tag and length checked, but their arguments are unchecked.\n\nAll other terms and guard clauses are ignored.\n\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:total, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpil%2Ftotal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpil%2Ftotal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpil%2Ftotal/lists"}