Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zwilias/elm-rosetree
Rosetree/multiway trees in Elm
https://github.com/zwilias/elm-rosetree
elm multiway-tree zipper
Last synced: 2 months ago
JSON representation
Rosetree/multiway trees in Elm
- Host: GitHub
- URL: https://github.com/zwilias/elm-rosetree
- Owner: zwilias
- License: bsd-3-clause
- Created: 2018-02-21T18:57:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T08:13:02.000Z (over 1 year ago)
- Last Synced: 2024-10-13T02:21:45.855Z (3 months ago)
- Topics: elm, multiway-tree, zipper
- Language: Elm
- Homepage: http://package.elm-lang.org/packages/zwilias/elm-rosetree/latest
- Size: 245 KB
- Stars: 45
- Watchers: 7
- Forks: 9
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multiway trees and a zipper [![Build Status](https://travis-ci.org/zwilias/elm-rosetree.svg?branch=master)](https://travis-ci.org/zwilias/elm-rosetree)
This library provides a multiway tree (also known as rosetree) datastructure,
and a zipper to navigate through it.A multiway tree is a non-empty tree where every node has a `label` and a list of
children, each of which is a tree.The basic structure looks like this:
```elm
type Tree a = Tree { label : a, children : List (Tree a) }
```You can think of it as a multidimensional non-empty list. The root always has a
label and may branch out in multiple directions.A tree zipper is a datastructure that allows navigating through a tree. It
represents a waypoint along walking the tree. It can focus on an arbitratry part
of the tree, be used to modify and transform that part of the tree, and rebuild
the entire tree back up to the root.# Performance and stack-safety
Since trees can grow pretty large, a lot of effort has gone into making all the
functions in the `Tree` module work stack-safely. All the iteration functions in
that module are written to make use of Elm's support for tail call elimination.Making these functions highly performant without losing out on the safety is a
continuous effort.# Contributing
Contributions are preferred to take the form of collaboration. Questions, bug
reports and feature requests are welcome as GitHub issues. Before starting any
concrete work, opening a discussion is very much appreciated.---
Made with love and released under the BSD-3 license.