{"id":16314049,"url":"https://github.com/lysxia/breadcrumbs","last_synced_at":"2025-04-24T00:57:56.463Z","repository":{"id":149399832,"uuid":"73496965","full_name":"Lysxia/breadcrumbs","owner":"Lysxia","description":"Persistent bounded buffers","archived":false,"fork":false,"pushed_at":"2016-11-17T10:14:08.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T00:57:53.409Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/Lysxia.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-11T17:19:30.000Z","updated_at":"2016-12-01T11:31:06.000Z","dependencies_parsed_at":"2023-07-25T16:03:18.731Z","dependency_job_id":null,"html_url":"https://github.com/Lysxia/breadcrumbs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lysxia%2Fbreadcrumbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lysxia%2Fbreadcrumbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lysxia%2Fbreadcrumbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lysxia%2Fbreadcrumbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lysxia","download_url":"https://codeload.github.com/Lysxia/breadcrumbs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250541005,"owners_count":21447427,"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-10-10T21:53:05.298Z","updated_at":"2025-04-24T00:57:56.425Z","avatar_url":"https://github.com/Lysxia.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Persistent Bounded Buffers\n==========================\n\nVarious persistent implementations of finite sequences/circular buffers, where\ninserting an element pushes the oldest one out.\n\nWith a buffer size of 3:\n\n                    \"\"\n    push 's'\n                    \"s\"\n    push 'n'\n                    \"ns\"\n    push 'o'\n                    \"ons\"\n    push 'm'\n                    \"mon\"\n    push 'e'\n                    \"emo\"\n    push 'l'\n                    \"lem\"\n\nMore formally, a `Buffer` is a *persistent* data structure supporting the\nfollowing operations:\n\n```haskell\n-- Create an empty buffer with size n.\nempty :: Int -\u003e Buffer a\n\n-- Insert an element.\npush :: a -\u003e Buffer a -\u003e Buffer a\n\n-- Access the last n inserted elements,\n-- or less if not that many have been inserted.\nbufferToList :: Buffer a -\u003e [a]\n```\n\nImplementations\n---------------\n\n- `List`: A naive implementation with a simple list which consumes arbitrarily\n  more memory than necessary.\n\n- `DropList`: A less naive implementation which truncates the list just enough,\n  at a cost.\n\n- `Seq`: Based on `Data.Sequence` (finite sequences, implemented with finger\n  trees).\n\n- `Deque`: The simple purely functional deque. Amortized constant time insertion.\n\n- `Flips`: A purely functional deque-like structure exploiting the boundedness\n  of the buffer to achieve worst-case constant time insertion.\n\n- `Breadcrumbs`: A variant of the\n  [\"tree buffers\"](https://arxiv.org/abs/1504.04757) algorithm that exploits\n  automatically managed memories to clean up a list-like structure.\n\n- `IO`: An interface of `Breadcrumbs` that does not lie about its impurity.\n  One may sometimes access more elements than they asked, if they haven't been\n  garbage-collected.\n\n- `Internal`: Internals of `Breadcrumbs`.\n\n- `Caterpillar`: A purely functional variant of tree buffers. Also much faster.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flysxia%2Fbreadcrumbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flysxia%2Fbreadcrumbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flysxia%2Fbreadcrumbs/lists"}