{"id":18357133,"url":"https://github.com/funkia/purescript-rrb-list","last_synced_at":"2026-01-20T08:32:27.608Z","repository":{"id":58242430,"uuid":"134447505","full_name":"funkia/purescript-rrb-list","owner":"funkia","description":"Highly efficient immutable list powered RRB-trees implementing the Data.Array API","archived":false,"fork":false,"pushed_at":"2023-10-16T06:24:05.000Z","size":64,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-10T10:09:06.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PureScript","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/funkia.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":"2018-05-22T16:58:07.000Z","updated_at":"2023-10-16T05:50:24.000Z","dependencies_parsed_at":"2024-12-23T22:12:39.616Z","dependency_job_id":"ee7b210e-fd01-4d3e-8432-f83378b81582","html_url":"https://github.com/funkia/purescript-rrb-list","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":"0.30000000000000004","last_synced_commit":"374d946257e3481806d34d0c406a09bd587e120d"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/funkia/purescript-rrb-list","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkia%2Fpurescript-rrb-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkia%2Fpurescript-rrb-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkia%2Fpurescript-rrb-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkia%2Fpurescript-rrb-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funkia","download_url":"https://codeload.github.com/funkia/purescript-rrb-list/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funkia%2Fpurescript-rrb-list/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28599006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: 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":[],"created_at":"2024-11-05T22:12:56.436Z","updated_at":"2026-01-20T08:32:27.586Z","avatar_url":"https://github.com/funkia.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purescript-rrb-list\n\n[![Latest release](http://img.shields.io/github/release/funkia/purescript-rrb-list.svg)](https://github.com/funkia/purescript-rrb-list/releases)\n[![Build status](https://travis-ci.org/funkia/purescript-rrb-list.svg?branch=master)](https://travis-ci.org/funkia/purescript-rrb-list)\n[![Documentation](https://img.shields.io/badge/documentation-pursuit-45516b.svg)](http://pursuit.purescript.org/packages/purescript-rrb-list)\n\nA highly efficient immutable list implementing the `Data.Array` API.\n\n## About\n\npurescript-rrb-list is PureScript bindings for the TypeScript library\n[List](https://github.com/funkia/list) which is a highly optimized\nimplementation of the data-structure\n[RRB-trees](https://infoscience.epfl.ch/record/169879/files/RMTrees.pdf).\n\npurescript-rrb-list implements the `Data.Array` API and can serve as a\ndrop-in replacement for `Data.Array`.\n\n## Why use purescript-rrb-list\n\nJavaScript's native arrays are designed for imperative programming.\nDue to the nature of arrays they cannot benefit from structural\nsharing and any operation that changes an array must copy the entire\narray.\n\nRRB-trees, which purescript-rrb-list implements, offers good time\ncomplexity and low constants for a wide range of operations. This\nmakes it very well suited as a general purporse immutable list.\n\nThe table below compares the running-time of key operations.\n\n| Operation  | purescript-rrb-list | purescript-array | purescript-list |\n| ---------- | ------------------- | ---------------- | --------------- |\n| `cons`     | `O(1)`              | `O(n)`           | `O(1)`          |\n| `snoc`     | `O(1)`              | `O(n)`           | `O(n)`          |\n| `append`   | `O(log(max(n, m))`  | `O(n + m)`       | `O(n + m)`      |\n| `slice`    | `O(log(n))`         | `O(n)`           | `O(n)`          |\n| `insertAt` | `O(log(n))`         | `O(n)`           | `O(n)`          |\n| `head`     | `O(1)`              | `O(1)`           | `O(1)`          |\n| `last`     | `O(1)`              | `O(1)`           | `O(n)`          |\n\n## When not to use purescript-rrb-list\n\npurescript-rrb-list is very fast for all operations which makes it\nsuitable as a go-to general purpose immutable list. However, this\nmeans that for use cases that only require few operations it is often\npossible to find a specialized data-structure that is faster.\n\nFor instance, even though purescript-rrb-list has `O(1)` running-time\nfor both `cons` and `tail` a single-linked list has lower constants\nfor these two operations. Thus for use cases that only require a stack\na single-linked list is faster.\n\nUse purescript-rrb-list if:\n\n* You need a wide range of operations. In this case RRB-trees cannot be beat.\n* If performance isn't a major concern. In this case you will benefit\n  from the generality of RRB-trees and get good performance without\n  having to think about it.\n\nDo not use purescript-rrb-list if:\n\n* You have more specialized use-case that only require few operations\n  and performance is critical. In this case it is likely that you can\n  find a specialized data-structure that performs better.\n\n## Installation\n\nFirst install the TypeScript library from npm.\n\n```\nnpm install list\n```\n\nAnd then the PureScript bindings from Bower.\n\n```\nbower install --save purescript-rrb-list\n```\n\n## Benchmarks\n\nThe TypeScript library on which purescript-rrb-list is based provides\n[an extensive benchmark\nsuite](https://funkia.github.io/list/benchmarks/) that compares the\nimplementation to JavaScript arrays and other immutable lists.\n\npurescript-rrb-list has also been inserted into the benchmark suite by\n[purescript-sequences](https://github.com/hdgarrood/purescript-sequences/issues/31#issue-308669682).\nThe results can be seen in [this\ncomment](https://github.com/hdgarrood/purescript-sequences/issues/31#issue-308669682).\n\n## API Docs\n\nAPI documentation is [published on\nPursuit](http://pursuit.purescript.org/packages/purescript-rrb-list).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkia%2Fpurescript-rrb-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunkia%2Fpurescript-rrb-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunkia%2Fpurescript-rrb-list/lists"}