Repository navigation
Releases
1.1.0
Adds:
sumUpa nice helper for computing values higher up the tree from values lower downsortByas a little convenience helper tosortWith
Improves:
stratifyWithPathnow won't create an extra root node if the tree has a single natural root node.
1.0.0
This is a fork of zwilias/elm-rosetree. This library should be mostly a drop-in replacement, with the following changes:
-
zwilias/elm-rosetree is the only library I could find that defines
andMap : Tree (a -> b) -> Tree a -> Tree b. This fork uses the standardandMap : Tree a -> Tree (a -> b) -> Tree b. -
A number of functions have been renamed from
mapXtoupdateX.mapin my mind represents a transformation that may change type and affects the whole datastructure. WhereasmapLabelandmapChildrenconfusingly only affected the root of the tree and could not change the type contained. -
flattenhas been renamedtoList. In my mindflatten : Tree (Tree a) -> Tree a. -
count is now length, since that's what pretty much every other datastructure calls it.
-
Treenow exposes it's constructor. I don't think this can break anything, but Elm considers it a breaking change...
Furthermore there are some improvements in this library you may find helpful:
-
we expose some very powerful new functions like depthFirstTraversal and breadthFirstFold. These are flexible enough that most of the library is implemented on top of these. This should have benefits for code size and performance.
-
we've added a bunch of useful utilities like
depth,links,sortWithandfind. -
we've added useful ways to help deserialize trees from flat file formats with
stratifyandstratifyWithPath.