{"id":13508536,"url":"https://github.com/pragdave/mdef","last_synced_at":"2025-10-21T18:55:29.591Z","repository":{"id":18573888,"uuid":"21776712","full_name":"pragdave/mdef","owner":"pragdave","description":"Easily define multiple function heads in elixir","archived":false,"fork":false,"pushed_at":"2020-03-08T01:19:28.000Z","size":8,"stargazers_count":49,"open_issues_count":3,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T07:47:46.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/pragdave.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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":"2014-07-12T21:15:28.000Z","updated_at":"2023-09-01T08:47:57.000Z","dependencies_parsed_at":"2022-07-26T23:02:09.002Z","dependency_job_id":null,"html_url":"https://github.com/pragdave/mdef","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/pragdave%2Fmdef","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragdave%2Fmdef/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragdave%2Fmdef/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pragdave%2Fmdef/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pragdave","download_url":"https://codeload.github.com/pragdave/mdef/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314011,"owners_count":20757450,"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":[],"created_at":"2024-08-01T02:00:54.488Z","updated_at":"2025-10-21T18:55:24.546Z","avatar_url":"https://github.com/pragdave.png","language":"Elixir","funding_links":[],"categories":["Macros","Miscellaneous"],"sub_categories":[],"readme":"MultiDef—Define a function with multiple heads\n==============================================\n\nAdd the dependency `{:multidef, \"\u003e 0.0.0\"}` to mix.exs.\n\nUse it like this:\n\n```elixir\ndefmodule Test do\n\n  import MultiDef\n\n  mdef fib do\n    0 -\u003e 0\n    1 -\u003e 1\n    n -\u003e fib(n-1) + fib(n-1)\n  end\nend\n```\n\n```elixir\nIO.puts Test.fib(20)\n```\n\nWhen clauses can be used:\n\n```elixir\ndefmodule Test do\n\n  import MultiDef\n\n  mdef fib do\n    0 -\u003e 0\n    1 -\u003e 1\n    n when n \u003e 0 -\u003e fib(n-1) + fib(n-1)\n  end\nend\n```\n\n```elixir\nIO.puts Test.fib(20)\n```\n\nDoes not support default arguments.\n\nDoes not enforce that all heads have the same arity (deliberately).\n\n----\n\nCopyright © 2014 Dave Thomas, The Pragmatic Programmers  \n@/+pragdave, dave@pragprog.com\n\nLicensed under the same terms as Elixir\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragdave%2Fmdef","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpragdave%2Fmdef","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragdave%2Fmdef/lists"}