Skip to content

Releases

1.1.0

Choose a tag to compare

@gampleman gampleman released this 06 Oct 10:56

Adds:

  • sumUp a nice helper for computing values higher up the tree from values lower down
  • sortBy as a little convenience helper to sortWith

Improves:

  • stratifyWithPath now won't create an extra root node if the tree has a single natural root node.

1.0.0

Choose a tag to compare

@gampleman gampleman released this 05 Oct 14:20
011172f

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 standard andMap : Tree a -> Tree (a -> b) -> Tree b.

  • A number of functions have been renamed from mapX to updateX. map in my mind represents a transformation that may change type and affects the whole datastructure. Whereas mapLabel and mapChildren confusingly only affected the root of the tree and could not change the type contained.

  • flatten has been renamed toList. In my mind flatten : Tree (Tree a) -> Tree a.

  • count is now length, since that's what pretty much every other datastructure calls it.

  • Tree now 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, sortWith and find.

  • we've added useful ways to help deserialize trees from flat file formats with stratify and stratifyWithPath.