{"id":15211114,"url":"https://github.com/lue-bird/elm-bits","last_synced_at":"2026-02-19T00:34:46.508Z","repository":{"id":47529009,"uuid":"363857385","full_name":"lue-bird/elm-bits","owner":"lue-bird","description":"0, 1 and bit lists of sizes that don't have to be multiples of 8","archived":false,"fork":false,"pushed_at":"2024-08-18T08:34:20.000Z","size":344,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T12:00:03.533Z","etag":null,"topics":["array-sized","bit","elm","safe","type-safe","typed","typesafe-array","vector"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/lue-bird/elm-bits/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lue-bird.png","metadata":{"files":{"readme":"README.md","changelog":"changes.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-03T07:59:13.000Z","updated_at":"2025-07-12T04:46:07.000Z","dependencies_parsed_at":"2024-08-18T09:53:42.369Z","dependency_job_id":null,"html_url":"https://github.com/lue-bird/elm-bits","commit_stats":{"total_commits":140,"total_committers":2,"mean_commits":70.0,"dds":"0.34285714285714286","last_synced_commit":"67dd290430b4dfed47ec9ecae0fc92590d285461"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/lue-bird/elm-bits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-bits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-bits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-bits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-bits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lue-bird","download_url":"https://codeload.github.com/lue-bird/elm-bits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lue-bird%2Felm-bits/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29599386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T22:25:43.180Z","status":"ssl_error","status_checked_at":"2026-02-18T22:25:42.766Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-sized","bit","elm","safe","type-safe","typed","typesafe-array","vector"],"created_at":"2024-09-28T08:04:57.921Z","updated_at":"2026-02-19T00:34:46.479Z","avatar_url":"https://github.com/lue-bird.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"0, 1 and bit lists of sizes that don't have to be multiples of 8.\n\n```elm\nimport Bit exposing (Bit(..))\nimport Bits\n\n-6 |\u003e Bits.fromIntSigned 5\n--\u003e [ I, I, O, I, O ]\n```\n\nUse when correctness/precision matters more than raw speed.\n\n## example use case: id\n\nMost id types use an opaque `type` to hold information.\nExample similar to [danyx23's `Uuid`][danyx23/elm-uuid] to skim through ↓\n\n```elm\nmodule OpaqueId exposing (OpaqueId, generate, toString)\n\ntype OpaqueId\n    = OpaqueId String\n\ntoString : OpaqueId -\u003e String\ntoString =\n    \\(OpaqueId string) -\u003e string\n\ngenerate : Random.Generator OpaqueId\ngenerate =\n    Random.map\n        (\\fifteenHexDigits -\u003e\n            OpaqueId\n                ([ fifteenHexDigits |\u003e List.take 4 |\u003e List.map mapToHex |\u003e String.fromList\n                 , \"-\"\n                 , fifteenHexDigits |\u003e List.drop 8 |\u003e List.take 4 |\u003e List.map mapToHex |\u003e String.fromList\n                 , \"-\"\n                 , \"4\"\n                 , fifteenHexDigits |\u003e List.drop 12 |\u003e List.take 2 |\u003e List.map mapToHex |\u003e String.fromList\n                 , \"-\"\n                 , fifteenHexDigits |\u003e List.drop 14 |\u003e List.take 1 |\u003e List.map limitDigitRange8ToB |\u003e List.map mapToHex |\u003e String.fromList\n                 ]\n                    |\u003e String.concat\n                )\n        )\n        (Random.list 15 (Random.int 0 15))\n```\n\nwith bits:\n\n```elm\nmodule MyId exposing (MyId(..))\n\nimport Bit exposing (Bit)\nimport Vector60\n\ntype MyId\n    = MyId (Vector60 Bit) -- depending on necessary bits\n```\n\nNotice how extracting information is easy and to creating a new id can be done safely (without e.g. requiring going through decoders, parsers, validations, opaque random generators etc.).\n\n🧩 `Vector60` is from [Chadtech/elm-vector](https://dark.elm.dmy.fr/packages/Chadtech/elm-vector/latest)\nbut anything will do the job, like a record, custom codegen or [lue-bird/elm-typesafe-array](https://dark.elm.dmy.fr/packages/lue-bird/elm-typesafe-array/latest/).\nHell even if you just use an opaque `List Bit` you'll still have it easier than with a `String`.\n\n## conversions\n\nBits as a universal way of representing information can be\nconverted from and to basically any shape → [example](https://github.com/lue-bird/elm-bits/tree/master/example)\n\n- different string formats like human-readable (for example [michaelglass/proquint](https://package.elm-lang.org/packages/michaelglass/proquint/latest/)), less character space, hexadecimal, ...\n- colors, shapes, identicons like\n[coinop-logan/phace](https://package.elm-lang.org/packages/coinop-logan/phace/latest/),\n[laurentpayot/minidenticons-elm](https://package.elm-lang.org/packages/laurentpayot/minidenticons-elm/latest/)\nor forks of [pukkamustard/elm-identicon](https://github.com/pukkamustard/elm-identicon)\n(like [dividat/elm-identicon](https://package.elm-lang.org/packages/dividat/elm-identicon/latest/)),\n[`miniBill/elm-avataaars`](https://dark.elm.dmy.fr/packages/miniBill/elm-avataaars/latest/),\n...\n\n## where `elm-bits` is used\n\n- [`elm-morph`](https://package.elm-lang.org/packages/lue-bird/elm-morph/latest) can\n  create a parser-builder that can even read non-byte-multiple bit counts like 7\n- maybe you built something? Tell me about it ✿\n\n\n\n----\n\nConfused? Hyped? Hit @lue up on anything on slack\n\n[danyx23/elm-uuid]: https://package.elm-lang.org/packages/danyx23/elm-uuid/latest/Uuid\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-bits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flue-bird%2Felm-bits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flue-bird%2Felm-bits/lists"}