{"id":19206018,"url":"https://github.com/whiletruu/elm-one-to-one","last_synced_at":"2026-06-16T12:31:21.032Z","repository":{"id":62418240,"uuid":"361508743","full_name":"WhileTruu/elm-one-to-one","owner":"WhileTruu","description":"A data structure for one-to-one mapping between values.","archived":false,"fork":false,"pushed_at":"2021-04-25T18:42:29.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-04T15:15:16.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WhileTruu.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}},"created_at":"2021-04-25T18:35:38.000Z","updated_at":"2021-04-25T18:42:20.000Z","dependencies_parsed_at":"2022-11-01T16:47:19.471Z","dependency_job_id":null,"html_url":"https://github.com/WhileTruu/elm-one-to-one","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/WhileTruu%2Felm-one-to-one","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhileTruu%2Felm-one-to-one/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhileTruu%2Felm-one-to-one/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhileTruu%2Felm-one-to-one/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhileTruu","download_url":"https://codeload.github.com/WhileTruu/elm-one-to-one/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240279076,"owners_count":19776204,"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-11-09T13:14:29.343Z","updated_at":"2026-06-16T12:31:21.026Z","avatar_url":"https://github.com/WhileTruu.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneToOne\n\nA data structure for one-to-one mapping between values. A 'OneToOne' is essentially\na [bijection](https://en.wikipedia.org/wiki/Bijection) between subsets of\nits two argument types.\n\nEvery `first` value is associated with exactly one `second` value and vice versa.\nCompare this to a [Dict](https://package.elm-lang.org/packages/elm/core/latest/Dict)\n, where every key is associated with exactly one value, but a value can be associated\nwith more than one key.\n\nInternally, a `OneToOne` one is composed of two dictionaries, one for the first-to-second direction \nand one for second-to-first. As such, insert, remove, and query operations all \nhave the same big-O performance as dictionaries.\n\n\n\n```elm\n\nimport OneToOne exposing (OneToOne)\n\nmyOneToOne : OneToOne String Int\nmyOneToOne =\n    OneToOne.empty\n        |\u003e OneToOne.insert \"potato\" 100\n        |\u003e OneToOne.insert \"cabbage\" 200\n        |\u003e OneToOne.insert \"tomato\" 300\n        |\u003e OneToOne.insert \"tomato\" 100\n\nOneToOne.toList myOneToOne \n--\u003e [ ( \"cabbage\", 200 ), ( \"tomato\", 100 ) ] \n\n\n```\n\n## Tests\n\nThis package uses\n[elm-test](https://github.com/elm-explorations/test) and \n[elm-verify-examples](https://github.com/stoeffel/elm-verify-examples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiletruu%2Felm-one-to-one","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhiletruu%2Felm-one-to-one","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhiletruu%2Felm-one-to-one/lists"}