{"id":13561675,"url":"https://github.com/harmboschloo/elm-dict-intersect","last_synced_at":"2025-04-03T21:16:08.288Z","repository":{"id":62418548,"uuid":"173431418","full_name":"harmboschloo/elm-dict-intersect","owner":"harmboschloo","description":"Provides intersections of multiple dictionaries","archived":false,"fork":false,"pushed_at":"2019-03-02T10:01:33.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T09:13:06.914Z","etag":null,"topics":["dictionaries","elm","intersection"],"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/harmboschloo.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":"2019-03-02T09:58:50.000Z","updated_at":"2023-11-04T19:54:47.000Z","dependencies_parsed_at":"2022-11-01T16:46:20.504Z","dependency_job_id":null,"html_url":"https://github.com/harmboschloo/elm-dict-intersect","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/harmboschloo%2Felm-dict-intersect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmboschloo%2Felm-dict-intersect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmboschloo%2Felm-dict-intersect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmboschloo%2Felm-dict-intersect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harmboschloo","download_url":"https://codeload.github.com/harmboschloo/elm-dict-intersect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247078864,"owners_count":20879952,"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":["dictionaries","elm","intersection"],"created_at":"2024-08-01T13:00:59.839Z","updated_at":"2025-04-03T21:16:08.266Z","avatar_url":"https://github.com/harmboschloo.png","language":"Elm","readme":"# Dict.Intersect\n\nProvides intersections of multiple dictionaries based on their key.\n\n## Example\n\n```elm\nimport Dict exposing (Dict)\nimport Dict.Intersect\n\n\ntype alias Car =\n    { wheels : Int\n    }\n\n\ntype alias Boat =\n    { speed : Float\n    }\n\n\ntype alias Amphibian =\n    { car : Car\n    , boat : Boat\n    }\n\n\ncars : Dict Int Car\ncars =\n    Dict.fromList [ ( 0, Car 4 ), ( 1, Car 4 ), ( 2, Car 6 ) ]\n\n\nboats : Dict Int Boat\nboats =\n    Dict.fromList [ ( 2, Boat 20 ), ( 3, Boat 30 ) ]\n\n\namphibians : List ( Int, Amphibian )\namphibians =\n    Dict.Intersect.foldr2\n        (\\id car boat list -\u003e ( id, Amphibian car boat ) :: list)\n        []\n        cars\n        boats\n\n\n-- amphibians == [ ( 2, { boat = { speed = 20 }, car = { wheels = 6 } } ) ]\n```\n\n## Note on performance\n\nWhen folding over multiple dictionaries it is generally faster to have the smallest dictionary as the first argument and the one with the least amount of intersections next. See [these benchmarks](https://github.com/harmboschloo/elm-dict-intersect/blob/master/benchmarks/src/OrderPerformance.elm) for an example.\n","funding_links":[],"categories":["Elm"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmboschloo%2Felm-dict-intersect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharmboschloo%2Felm-dict-intersect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmboschloo%2Felm-dict-intersect/lists"}