ema-0.4.0.0: Static site generator library with hot reload
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ema.Helper.PathTree

Description

Helper to deal with slug trees

Synopsis

Documentation

treeInsertPath :: Eq a => NonEmpty a -> [Tree a] -> [Tree a] Source #

treeInsertPathMaintainingOrder :: (Eq a, Ord ord) => (NonEmpty a -> ord) -> NonEmpty a -> [Tree a] -> [Tree a] Source #

Insert a node by path into a tree with descendants that are ordered.

Insertion will guarantee that descendants continue to be ordered as expected.

The order of descendents is determined by the given order function, which takes the path to a node and return that node's order. The intention is to lookup the actual order value which exists *outside* of the tree datastructure itself.

treeDeletePath :: Eq a => NonEmpty a -> [Tree a] -> [Tree a] Source #

treeDeleteLeafPath :: Eq a => NonEmpty a -> [Tree a] -> [Tree a] Source #

treeDeletePathWithLastBehavingAs :: forall a. Eq a => (a -> [Tree a] -> [Tree a]) -> NonEmpty a -> [Tree a] -> [Tree a] Source #

treeDeleteChild :: Eq a => a -> [Tree a] -> [Tree a] Source #