Skip to content

Add documentation for TreeList data structure#802

Open
krrishverma1805-web wants to merge 1 commit intotypelevel:masterfrom
krrishverma1805-web:add-treelist-docs
Open

Add documentation for TreeList data structure#802
krrishverma1805-web wants to merge 1 commit intotypelevel:masterfrom
krrishverma1805-web:add-treelist-docs

Conversation

@krrishverma1805-web
Copy link

What this PR does

Adds a documentation page for the TreeList data structure with runnable mdoc examples.

Why

TreeList is a significant data structure in cats-collections — it provides O(1) cons/uncons with O(log N) random access, and its stack-safe traversals make it useful for large collections. However, it currently has no documentation page, unlike other data structures such as Heap, Diet, Dequeue, Set, etc.

Contents

The new page covers:

  • What TreeList is and its theoretical background (Okasaki's Purely Functional Random Access Lists)
  • Supported operations with complexity information
  • Runnable mdoc examples: creation, random access, prepend/uncons, update, construction from List, and concatenation

Checklist

  • Follows existing documentation style (consistent with dequeue.md, binaryheap.md, etc.)
  • All mdoc examples compile successfully (sbt docs/mdoc — 0 errors)
  • Covers key operations with complexity annotations

@krrishverma1805-web
Copy link
Author

krrishverma1805-web commented Feb 27, 2026

Hi @gemelen 👋

Would love your thoughts on this one when you get a chance. It addresses one of the items in TODO.md around making arbitrary instances available to downstream projects. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant