{"id":21224444,"url":"https://github.com/eignnx/char-list","last_synced_at":"2025-07-06T03:07:40.327Z","repository":{"id":61991941,"uuid":"555015355","full_name":"eignnx/char-list","owner":"eignnx","description":"A persistent string type with the same API as a linked-list of characters.","archived":false,"fork":false,"pushed_at":"2024-05-13T01:45:09.000Z","size":223,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T22:16:31.049Z","etag":null,"topics":["data-structures","dynamic-array","functional-data-structure","immutable","linked-list","persistent-data-structure"],"latest_commit_sha":null,"homepage":"https://docs.rs/char-list/latest/char_list/","language":"Rust","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/eignnx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-10-20T19:58:15.000Z","updated_at":"2024-05-13T01:45:12.000Z","dependencies_parsed_at":"2024-05-13T02:49:19.783Z","dependency_job_id":null,"html_url":"https://github.com/eignnx/char-list","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"4e620745c230f98808ff63e0a0f0102cfb66f7e3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eignnx/char-list","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eignnx%2Fchar-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eignnx%2Fchar-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eignnx%2Fchar-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eignnx%2Fchar-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eignnx","download_url":"https://codeload.github.com/eignnx/char-list/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eignnx%2Fchar-list/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263841616,"owners_count":23518488,"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":["data-structures","dynamic-array","functional-data-structure","immutable","linked-list","persistent-data-structure"],"created_at":"2024-11-20T22:58:27.813Z","updated_at":"2025-07-06T03:07:40.284Z","avatar_url":"https://github.com/eignnx.png","language":"Rust","readme":"# char-list\nA persistent string type with the same API as a linked-list of characters.\n\n## Contents\n### `FiniteCharList`\nThe `FiniteCharList` type is probably what you want to use. It behaves just like a linked list of characters but with better (TODO: verify) performance.\n\n### `CharList\u003cTail\u003e`\nThe `CharList\u003cTail\u003e` type allows customization of the data structure by allowing a custom tail. I'm using this to emulate Prolog's open-ended lists where the tail of the list may be an uninstantiated Prolog variable.\n\nA `FiniteCharList` is just a type alias for `CharList\u003c()\u003e`.\n\nGeneric `CharList`s have much fewer abilities provided by this crate because the nature of the tail is unknown. For instance, `CharList\u003cTail\u003e` does *not* implement `AsRef\u003cstr\u003e` or even `PartialEq`!\n\nThe intention is that you will wrap a `CharList\u003cYourTail\u003e` in a newtype and implement those traits if it makes sense for your problem space. For example, I (plan to) use a `CharList\u003cast::Expression\u003e` which *will* implement `PartialEq` because I want syntactic equality.\n\n## Docs\nSee the [docs](https://docs.rs/char-list/latest/char_list/) for memory-layout ***diagrams*** and explanations of how it all works.\n\n## DISCLAIMER: `unsafe`\nThis crate is a work in progress. Specifically ***Not all uses of `unsafe` have been validated!*** Please don't use this for anything serious yet.\n\nSafety audits are welcome and appreciated! I'm still quite new to writing `unsafe` code.\n\nAlso, this crate depends on [`front-vec`](https://crates.io/crates/front-vec) which is also badly in need of auditing.\n\n## Example\n\n```rust\nuse assert2::assert; // For nicer assertions.\nlet icon = FiniteCharList::from(\"icon\");\nlet nomicon = icon.cons_str(\"nom\");\nlet rustonomicon = nomicon.cons_str(\"rusto\");\n\n// Cloning requires\n//     1) copying two words, and\n//     2) performing one BTreeMap lookup.\nlet rustonomicon2 = rustonomicon.clone();\n\nassert!(icon == \"icon\");\nassert!(nomicon == \"nomicon\");\nassert!(rustonomicon == \"rustonomicon\");\nassert!(rustonomicon == rustonomicon2);\n\n// No new allocations required (if underlying buffer capacity allows).\n// Mutably prepends the `\u0026str` to the buffer without shifting memory.\nlet the_book = rustonomicon.cons_str(\"the \");\nassert!(the_book == \"the rustonomicon\");\n\n// Drop to mutably resize underlying buffer and \ndrop(rustonomicon);\ndrop(the_book);\ndrop(rustonomicon2);\n\nlet janelle_monae = icon.cons('b'); // Duplication required now.\nassert!(janelle_monae == \"bicon\");\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feignnx%2Fchar-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feignnx%2Fchar-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feignnx%2Fchar-list/lists"}