{"id":22096717,"url":"https://github.com/rl-king/elm-index","last_synced_at":"2025-03-24T01:18:26.166Z","repository":{"id":62419471,"uuid":"284322327","full_name":"rl-king/elm-index","owner":"rl-king","description":"A taggable wrapper around Int","archived":false,"fork":false,"pushed_at":"2020-08-02T12:04:39.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T07:32:15.310Z","etag":null,"topics":["array","elm","index","list","reorderable","type"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/rl-king/elm-index/latest/","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/rl-king.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-01T19:05:15.000Z","updated_at":"2020-11-01T13:30:59.000Z","dependencies_parsed_at":"2022-11-01T16:31:44.082Z","dependency_job_id":null,"html_url":"https://github.com/rl-king/elm-index","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/rl-king%2Felm-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rl-king%2Felm-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rl-king","download_url":"https://codeload.github.com/rl-king/elm-index/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245191590,"owners_count":20575250,"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":["array","elm","index","list","reorderable","type"],"created_at":"2024-12-01T04:12:19.651Z","updated_at":"2025-03-24T01:18:26.144Z","avatar_url":"https://github.com/rl-king.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# elm-index\n\nDisambiguate between different `Index` types by taggging `Index a`.\n\n``` elm\n-- With an anonymous record.\ntype alias RecordIndex =\n    Index { record : () }\n\n-- You could use some type you already have.\ntype BlockContent\n    = Text String\n    | Image String\n\ntype alias BlockIndex =\n    Index BlockContent\n\n-- Or, if you don't want to write `Index a` everywhere.\ntype alias Index =\n    Index ()\n\n```\n\nReplace `Int` with the `Index a` type.\n\n``` elm\nexample : List ( Index { example : () }, String )\nexample =\n    Index.indexedMap List.indexedMap\n        Tuple.pair\n        [\"hallo\", \"hola\", \"hello\"]\n\nexample : Array ( Index { example : () }, Int )\nexample =\n    Index.indexedMap Array.indexedMap\n        Tuple.pair\n        (Array.fromList [1, 2, 3])\n```\n\n\nMake functions that expect an `Int` take an `Index a`.\n\n``` elm\nexample : Index { example : () } -\u003e Maybe Int\nexample index =\n    Index.withIndex Array.get index \u003c|\n        Array.fromList [1, 2, 3]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frl-king%2Felm-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frl-king%2Felm-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frl-king%2Felm-index/lists"}