Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Tree.Path
Synopsis
- treeInsertPath :: Eq a => NonEmpty a -> [Tree a] -> [Tree a]
- treeInsertPathMaintainingOrder :: (Eq a, Ord ord) => (NonEmpty a -> ord) -> NonEmpty a -> [Tree a] -> [Tree a]
- treeDeletePath :: Eq a => NonEmpty a -> [Tree a] -> [Tree a]
- treeDeleteLeafPath :: Eq a => NonEmpty a -> [Tree a] -> [Tree a]
- treeDeletePathWithLastBehavingAs :: forall a. Eq a => (a -> [Tree a] -> [Tree a]) -> NonEmpty a -> [Tree a] -> [Tree a]
- treeDeleteChild :: Eq a => a -> [Tree a] -> [Tree a]
Documentation
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.