{"id":13513558,"url":"https://github.com/functional-data-structure/finger-tree","last_synced_at":"2026-02-21T00:37:40.261Z","repository":{"id":37174765,"uuid":"41967640","full_name":"functional-data-structure/finger-tree","owner":"functional-data-structure","description":":cactus: Finger tree data structure for JavaScript","archived":false,"fork":false,"pushed_at":"2025-08-19T19:13:22.000Z","size":5711,"stargazers_count":27,"open_issues_count":13,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-31T08:44:18.213Z","etag":null,"topics":["agpl","computer-science","data-structures","finger-tree","fully-persistent","functional","immutable","javascript","persistent","trees"],"latest_commit_sha":null,"homepage":"https://functional-data-structure.github.io/finger-tree","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/functional-data-structure.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,"zenodo":null}},"created_at":"2015-09-05T16:20:03.000Z","updated_at":"2025-09-23T22:54:09.000Z","dependencies_parsed_at":"2023-12-21T08:48:18.720Z","dependency_job_id":"76b4e32d-7858-4d12-a845-95908b1423eb","html_url":"https://github.com/functional-data-structure/finger-tree","commit_stats":{"total_commits":671,"total_committers":8,"mean_commits":83.875,"dds":0.587183308494784,"last_synced_commit":"a251139add52d853c24b8359b094d754451e2e6c"},"previous_names":["aureooms/js-fingertree"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/functional-data-structure/finger-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functional-data-structure%2Ffinger-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functional-data-structure%2Ffinger-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functional-data-structure%2Ffinger-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functional-data-structure%2Ffinger-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/functional-data-structure","download_url":"https://codeload.github.com/functional-data-structure/finger-tree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/functional-data-structure%2Ffinger-tree/sbom","scorecard":{"id":216538,"data":{"date":"2025-08-11","repo":{"name":"github.com/functional-data-structure/finger-tree","commit":"8af437f8bc2a97731df2cb1e730331d34ef13155"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":10,"reason":"14 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/ci:cover.yml:1","Warn: no topLevel permission defined: .github/workflows/ci:lint-config.yml:1","Warn: no topLevel permission defined: .github/workflows/ci:lint.yml:1","Warn: no topLevel permission defined: .github/workflows/gh-pages.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci:cover.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci:cover.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci:cover.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci:cover.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci:cover.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci:cover.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci:lint-config.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci:lint-config.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci:lint-config.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci:lint-config.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci:lint.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci:lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci:lint.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/ci:lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gh-pages.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/gh-pages.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gh-pages.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/functional-data-structure/finger-tree/gh-pages.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/gh-pages.yml:15","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"35 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T01:45:20.112Z","repository_id":37174765,"created_at":"2025-08-17T01:45:20.112Z","updated_at":"2025-08-17T01:45:20.112Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29668711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"ssl_error","status_checked_at":"2026-02-20T23:52:33.807Z","response_time":59,"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":["agpl","computer-science","data-structures","finger-tree","fully-persistent","functional","immutable","javascript","persistent","trees"],"created_at":"2024-08-01T05:00:31.226Z","updated_at":"2026-02-21T00:37:40.243Z","avatar_url":"https://github.com/functional-data-structure.png","language":"JavaScript","funding_links":[],"categories":[":baby: Children"],"sub_categories":[],"readme":":cactus: [@functional-data-structure/finger-tree](https://functional-data-structure.github.io/finger-tree)\n==\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://cdn.rawgit.com/functional-data-structure/finger-tree/main/media/sketch.svg\" width=\"400\"\u003e\n\u003c/p\u003e\n\nFinger trees for JavaScript.\nSee [docs](https://functional-data-structure.github.io/finger-tree).\nParent is [@functional-data-structure/persistent](https://github.com/functional-data-structure/persistent).\n\n    data FingerTree x = Empty\n                      | Single x\n                      | Deep ( Digit x ) ( FingerTree ( Node x ) ) ( Digit x )\n\n[![License](https://img.shields.io/github/license/functional-data-structure/finger-tree.svg)](https://raw.githubusercontent.com/functional-data-structure/finger-tree/main/LICENSE)\n[![Version](https://img.shields.io/npm/v/@functional-data-structure/finger-tree.svg)](https://www.npmjs.org/package/@functional-data-structure/finger-tree)\n[![Tests](https://img.shields.io/github/actions/workflow/status/functional-data-structure/finger-tree/ci.yml?branch=main\u0026event=push\u0026label=tests)](https://github.com/functional-data-structure/finger-tree/actions/workflows/ci.yml?query=branch:main)\n[![Dependencies](https://img.shields.io/librariesio/github/functional-data-structure/finger-tree.svg)](https://github.com/functional-data-structure/finger-tree/network/dependencies)\n[![GitHub issues](https://img.shields.io/github/issues/functional-data-structure/finger-tree.svg)](https://github.com/functional-data-structure/finger-tree/issues)\n[![Downloads](https://img.shields.io/npm/dm/@functional-data-structure/finger-tree.svg)](https://www.npmjs.org/package/@functional-data-structure/finger-tree)\n\n[![Code issues](https://img.shields.io/codeclimate/issues/functional-data-structure/finger-tree.svg)](https://codeclimate.com/github/functional-data-structure/finger-tree/issues)\n[![Code maintainability](https://img.shields.io/codeclimate/maintainability/functional-data-structure/finger-tree.svg)](https://codeclimate.com/github/functional-data-structure/finger-tree/trends/churn)\n[![Code coverage (cov)](https://img.shields.io/codecov/c/gh/functional-data-structure/finger-tree/main.svg)](https://codecov.io/gh/functional-data-structure/finger-tree)\n[![Code technical debt](https://img.shields.io/codeclimate/tech-debt/functional-data-structure/finger-tree.svg)](https://codeclimate.com/github/functional-data-structure/finger-tree/trends/technical_debt)\n[![Documentation](https://functional-data-structure.github.io/finger-tree/badge.svg)](https://functional-data-structure.github.io/finger-tree/source.html)\n[![Package size](https://img.shields.io/bundlephobia/minzip/@functional-data-structure/finger-tree)](https://bundlephobia.com/result?p=@functional-data-structure/finger-tree)\n\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [:woman_teacher: API reference](#woman_teacher-api-reference)\n  * [:cactus: Definition of a `Tree`](#cactus-definition-of-a-tree)\n  * [:straight_ruler: Definition of a `Measure`](#straight_ruler-definition-of-a-measure)\n    * [Example of a `Measure`](#example-of-a-measure)\n  * [:package: How to `import`](#package-how-to-import)\n  * [:baby: How to create a `Tree`](#baby-how-to-create-a-tree)\n    * [`empty(Measure) -\u003e Tree`](#emptymeasure---tree)\n    * [`from(Measure, Iterable) -\u003e Tree`](#frommeasure-iterable---tree)\n  * [:question: Predicates](#question-predicates)\n    * [`Tree#measure() -\u003e m`](#treemeasure---m)\n    * [`Tree#isEmpty() -\u003e Boolean`](#treeisempty---boolean)\n  * [:salt: Add values](#salt-add-values)\n    * [`Tree#push(x) -\u003e Tree`](#treepushx---tree)\n    * [`Tree#cons(x) -\u003e Tree`](#treeconsx---tree)\n    * [`Tree#append(Iterable) -\u003e Tree`](#treeappenditerable---tree)\n    * [`Tree#prepend(Iterable) -\u003e Tree`](#treeprependiterable---tree)\n  * [:pizza: Slice](#pizza-slice)\n    * [`Tree#head() -\u003e x`](#treehead---x)\n    * [`Tree#last() -\u003e x`](#treelast---x)\n    * [`Tree#init() -\u003e Tree`](#treeinit---tree)\n    * [`Tree#tail() -\u003e Tree`](#treetail---tree)\n  * [:last_quarter_moon: Merge](#last_quarter_moon-merge)\n    * [`Tree#concat(Tree) -\u003e Tree`](#treeconcattree---tree)\n  * [:broken_heart: Split](#broken_heart-split)\n    * [`Tree#splitTree(Function, m) -\u003e [ Tree , x , Tree ]`](#treesplittreefunction-m----tree--x--tree-)\n    * [`Tree#split(Function) -\u003e [ Tree , Tree ]`](#treesplitfunction----tree--tree-)\n    * [`Tree#takeUntil(Function) -\u003e Tree`](#treetakeuntilfunction---tree)\n    * [`Tree#dropUntil(Function) -\u003e Tree`](#treedropuntilfunction---tree)\n  * [:flying_saucer: Visit](#flying_saucer-visit)\n    * [`Tree[Symbol.iterator]() -\u003e Iterable`](#treesymboliterator---iterable)\n    * [`Tree#reversed() -\u003e Iterable`](#treereversed---iterable)\n* [:scroll: References](#scroll-references)\n* [:link: Links](#link-links)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## :woman_teacher: API reference\n\nThe data structure is\n[fully persistent](https://en.wikipedia.org/wiki/Persistent_data_structure#Fully_persistent):\nAll methods are pure functions that do not modify their object. \n\n\u003e The [parent project](https://github.com/functional-data-structure/persistent) shows how\n\u003e specialized persistent data structures can be build on top of those methods.\n\n\n### :cactus: Definition of a `Tree`\n\n    data Tree x = Empty\n                | Single x\n                | Deep ( Digit x ) ( Tree ( Node x ) ) ( Digit x )\n\n\n### :straight_ruler: Definition of a `Measure`\n\n    Measure = (\n      plus = ( x , x ) -\u003e m\n      measure = x -\u003e m\n      zero = ( ) =\u003e m\n    )\n\n#### Example of a `Measure`\n\nThe following measure will compute the size of each subtree.\n\n```js\nconst counter = {\n  plus : ( x , y ) =\u003e x + y ,\n  measure : x =\u003e 1 ,\n  zero : ( ) =\u003e 0 ,\n} ;\n```\n\nSee also\n[@functional-abstraction/measure](https://functional-abstraction.github.io/measure/file/src/1-api/1-Measures.js.html)\nfor more examples of measures and see\n[@functional-data-structure/persistent](https://github.com/functional-data-structure/persistent)\nfor examples of data structures that can be build on top of this abstraction.\n\n\n### :package: How to `import`\n\n\u003e :warning: The code requires `regeneratorRuntime` to be defined, for instance by importing\n\u003e [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).\n\nFirst, require the polyfill at the entry point of your application:\n```js\nrequire( 'regenerator-runtime/runtime' ) ;\n// or\nimport 'regenerator-runtime/runtime.js' ;\n```\n\nThen require what you need from the exported object, for instance the two main\nAPI functions `from` and `empty`:\n\n```js\nconst { from , empty } = require( '@functional-data-structure/finger-tree' ) ;\n// or\nimport { from , empty } from '@functional-data-structure/finger-tree' ;\n```\n\n\n### :baby: How to create a `Tree`\n\n#### `empty(Measure) -\u003e Tree`\n\nCreate an empty tree from [a measure object](#example-of-a-measure).\n\n```js\nlet tree = empty( counter ) ;\n```\n\n#### `from(Measure, Iterable) -\u003e Tree`\n\nCreate a tree from a measure object and an iterable.\n\n```js\nlet tree = from( counter , 'abc' ) ;\n```\n\n\n### :question: Predicates\n\n#### `Tree#measure() -\u003e m`\n\nReturns the measure of the tree.\n\n```js\nif ( tree.measure() \u003e 1 ) ...\n```\n\n#### `Tree#isEmpty() -\u003e Boolean`\n\nReturns `true` if the tree is empty, `false` otherwise.\n\n```js\nreturn tree.isEmpty() ? 'empty' : 'not empty' ;\n```\n\n\n### :salt: Add values\n\n#### `Tree#push(x) -\u003e Tree`\n\nReturns a new tree with an additional value as the new right-most value.\n\n```js\ntree = tree.push('k');\n```\n\n#### `Tree#cons(x) -\u003e Tree`\n\nReturns a new tree with an additional value as the new left-most value.\n\n```js\ntree = tree.cons('g');\n```\n\n#### `Tree#append(Iterable) -\u003e Tree`\n\nEquivalent to applying `push` to each value of the iterable in order.\n\n```js\ntree.append( 'www' ) ;\n```\n\n#### `Tree#prepend(Iterable) -\u003e Tree`\n\nEquivalent to applying `cons` to each value of the iterable in reverse order.\n\n```js\ntree.prepend( 'xyz' ) ;\n```\n\n\n### :pizza: Slice\n\n#### `Tree#head() -\u003e x`\n\nReturns the left-most value in the tree.\n\n```js\nlet head = tree.head() ; // 'a'\n```\n\n#### `Tree#last() -\u003e x`\n\nReturns the right-most value in the tree.\n\n```js\nlet last = tree.last() ; // 'b'\n```\n\n#### `Tree#init() -\u003e Tree`\n\nReturns a new tree without the right-most value.\n\n```js\nwhile ( ! tree.isEmpty() ) tree = tree.init() ;\n```\n\n#### `Tree#tail() -\u003e Tree`\n\nReturns a new tree without the left-most value.\n\n```js\nwhile ( ! tree.isEmpty() ) tree = tree.tail() ;\n```\n\n\n### :last_quarter_moon: Merge\n\n#### `Tree#concat(Tree) -\u003e Tree`\n\nReturns the concatenation of two trees.\n\n```js\ntree = tree.concat( tree );\n```\n\n\n### :broken_heart: Split\n\nThe following methods allow you to efficiently split a tree at the value\nwhere the measure crosses a given threshold.\n\n#### `Tree#splitTree(Function, m) -\u003e [ Tree , x , Tree ]`\n\nSplit the tree into a left tree, a middle value, and a right tree according to\na predicate on the measure of the tree __increased by a constant measure `m`__.\nThe predicate must be monotone, false then true, on prefixes of the values in\nleft-to-right order. The middle value `x` is the value for which the predicate\nswitches from false to true.\n\n```js\nlet [ left , middle , right ] = tree.splitTree( measure =\u003e measure \u003e 1 , 1 ) ;\n```\n\n#### `Tree#split(Function) -\u003e [ Tree , Tree ]`\n\nSplit the tree into a left tree and a right tree according to a predicate on\nthe measure of the tree. The predicate must be monotone, false then true, on\nprefixes of the values in left-to-right order. The left-most value of the right\ntree is the value for which the predicate switches from false to true.\n\n```js\nlet [ left , right ] = tree.split( measure =\u003e measure \u003e 2 ) ;\n```\n\n#### `Tree#takeUntil(Function) -\u003e Tree`\n\nReturns the left tree of `Tree#split`.\n\n```js\nlet left = tree.takeUntil( measure =\u003e measure \u003e 2 ) ;\n```\n\n#### `Tree#dropUntil(Function) -\u003e Tree`\n\nReturns the right tree of `Tree#split`.\n\n```js\nlet right = tree.dropUntil( measure =\u003e measure \u003e 2 ) ;\n```\n\n\n### :flying_saucer: Visit\n\n#### `Tree[Symbol.iterator]() -\u003e Iterable`\n\nReturns an iterator on the values of the tree in left-to-right order.\n\n```js\nfor ( const x of tree ) console.log( x ) ;\n```\n\n#### `Tree#reversed() -\u003e Iterable`\n\nReturns an iterator on the values of the tree in right-to-left order.\n\n```js\nfor ( const x of tree.reversed() ) console.log( x ) ;\n```\n\n\n## :scroll: References\n\n  - [*Finger trees: a simple general-purpose data structure* -- Hinze and Paterson](http://staff.city.ac.uk/~ross/papers/FingerTree.pdf)\n\n## :link: Links\n\n  - [A coffeescript implementation with ZLIB licensing](https://github.com/zot/Leisure/blob/master/src/lib/fingertree.coffee) (:white_check_mark: the implementation is correct)\n  - [An implementation in Python with Apache licensing](https://github.com/kachayev/fn.py/blob/master/fn/immutable/finger.py) (:warning: the implementation is missing [splitting functionality](#broken_heart-split))\n  - [A JavaScript implementation with MIT licensing](https://github.com/qiao/fingertree.js) (:rotating_light: [the implementation is incorrect](https://github.com/qiao/fingertree.js/issues/7))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctional-data-structure%2Ffinger-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunctional-data-structure%2Ffinger-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunctional-data-structure%2Ffinger-tree/lists"}