{"id":15366664,"url":"https://github.com/turbomack/chae-tree","last_synced_at":"2025-04-15T12:31:01.222Z","repository":{"id":57675268,"uuid":"69153331","full_name":"turboMaCk/chae-tree","owner":"turboMaCk","description":"Create multi level navigation in elm easily.","archived":false,"fork":false,"pushed_at":"2018-10-03T02:45:28.000Z","size":50,"stargazers_count":13,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T20:12:03.204Z","etag":null,"topics":["data-structures","elm"],"latest_commit_sha":null,"homepage":"http://package.elm-lang.org/packages/turboMaCk/chae-tree/latest","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/turboMaCk.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}},"created_at":"2016-09-25T08:49:18.000Z","updated_at":"2023-07-25T14:04:28.000Z","dependencies_parsed_at":"2022-09-26T20:41:32.322Z","dependency_job_id":null,"html_url":"https://github.com/turboMaCk/chae-tree","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboMaCk%2Fchae-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboMaCk%2Fchae-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboMaCk%2Fchae-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turboMaCk%2Fchae-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/turboMaCk","download_url":"https://codeload.github.com/turboMaCk/chae-tree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249072112,"owners_count":21208120,"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","elm"],"created_at":"2024-10-01T13:19:25.697Z","updated_at":"2025-04-15T12:31:01.202Z","avatar_url":"https://github.com/turboMaCk.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chae-Tree\n\n[![Build Status](https://travis-ci.org/turboMaCk/chae-tree.svg?branch=master)](https://travis-ci.org/turboMaCk/chae-tree)\n\n**This package is now deprecated and won't be upgraded for next version of elm!\nPlease pick one of following instead:**\n\n- [turboMaCk/lazy-tree-with-zipper](https://github.com/turboMaCk/lazy-tree-with-zipper) lazy rose-tree with zipper\n- [tomjkidd/elm-multiway-tree-zipper](https://github.com/tomjkidd/elm-multiway-tree-zipper/) strict rose-tree with zipper\n\nCreate multi-level navigation in elm easily.\n\nThis package provides essential abstractions for manipulating and creating tree data structure directly from your collection data.\n\nImagine you have collection of some items which has defined parent \u003c-\u003e children relationship.\nThis package provides easy and universal way to transform this list to tree like data structure\nand comes with easy to use functions you can use to work with it.\nFor example you can easily browse this tree by levels, getting ancestors of node etc.\n\nThis package makes no decision about neither `update` nor `model` nor `view`.\nYou can build your own application level logic as you wish and just use provided api to manipulate your data.\nEvery abstraction which you might need is build in so you're saved from thinking about implementation details\nand rather focus on actual UI and business logic.\n\nThe name comes from [Chaenomeles](https://en.wikipedia.org/wiki/Chaenomeles) and is reference to similarities with [RoseTree](https://en.wikipedia.org/wiki/Rose_tree)\n\n**The good place to start is by looking on [example code](https://github.com/turboMaCk/ChaeTree/tree/master/examples).**\n\n# Installation\n\n```\nelm-package install turboMaCk/chae-tree\n```\n\nFor more informations please follow [documentation](http://package.elm-lang.org/packages/turboMaCk/chae-tree/latest)\nor see [examples](https://github.com/turboMaCk/ChaeTree/tree/master/examples) of usage.\n\n# More About Data Structure\n\nYou might be familiar with [Rose Tree](https://en.wikipedia.org/wiki/Rose_tree) data structure.\nThe data structure this plugin uses is quite similar but not really the same.\nThis paragraph(s) is to explain similarities and differences between the two and more importantly explain why they are there.\nFirst things first **please do not use this implementation as an alternative to plain Rose Trees!**\nEven they share some similarities you can find it unnecessary hard to use this in every place you might want to use Rose Tree.\nThink about this as about more domain specific *tree like* structure which might be quite handy for one thing but not that good for some other.\n\n## Chae.Tree is Forest\n\nIn fact `Tree` in the context of this plugin **is not** node containing item and children.\nTree is collection of multiple nodes (`List` of `Node a` to be more precise).\nThanks to this `Chae.Tree` allows you to have multiple nodes in root.\nFor example think about collection of categories where every category can have multiple sub-categories.\nIn that case `Tree` is actual collection and every category is one `Node` in that tree.\n\n## Chae.Node is not Rose Tree Either\n\nNow you might be thinking that if `Tree` is just an alias for `List (Node a)` than `Node a` is actually a Rose Tree.\nYou're partially right! In fact `Node` is pretty close to Rose Tree definition which might look like:\n\n```elm\ntype RoseTree a = Node a (List (RoseTree a))\n```\n\nin fact node is defined as follows:\n\n```elm\ntype Node a = Node Id a (List (Node a))\n\n```\n\nSo what is that magic `Id`? `Id` is just alias for `String`. And this Id/String is used as identifier for that node.\nThe string is used since you can easily represent any value using string\nand since it do not makes much sense to allow any arithmetics over identifier it's perfect fit for ids.\n\nSo every node in `Tree` has its id. What is this good for? Well first of all you can lookup any node by knowing its id.\nAlso it is super easy to build tree from plain `List` if you just know what is a parent of each item in that list.\n\n**All these functions are implemented for you so you can simple transform your flat collection into tree and start quering it by ids.**\n\n## Functors\n\nBeside this both `Node` and `Tree` are functors and you can find essential functions like `map`, `reduce`, `zip` and similar\nin particular module.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbomack%2Fchae-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturbomack%2Fchae-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturbomack%2Fchae-tree/lists"}