tomjkidd/elm-multiway-tree-zipper/1.2.0

NOTE: this package is not compatible with Elm 0.19.1

MultiwayTree

A library for constructing multi-way trees. Each Tree carries two pieces of information, it's datum and children.

Types

type Tree a
= Tree a (Forest a)

A type to keep track of datum and children.

type alias Forest a =
List (Tree a)

A list of Trees. Convenient for describing children.

Operations

datum : Tree a -> a

Access the datum of the current tree

children : Tree a -> Forest a

Access the children of the current tree

foldl : (a -> b -> b) -> b -> Tree a -> b

Reduce a Tree from the left.

foldr : (a -> b -> b) -> b -> Tree a -> b

Reduce a Tree from the right.

flatten : Tree a -> List a

Flattens a Tree into a List where the root is the first element of that list.

Mapping

map : (a -> b) -> Tree a -> Tree b

Map over the MultiwayTree