hawl-2006.6.4ContentsIndex
Hawl.Data.PathTree
Synopsis
data Tree a
= Node (Map String (Tree a))
| Leaf a
empty :: Tree a
fromList :: [(Path, a)] -> Tree a
insert :: Path -> a -> Tree a -> Tree a
lookup :: Monad m => Path -> Tree a -> m a
toList :: Tree a -> [(Path, a)]
addPrefix :: Path -> Tree a -> Tree a
Documentation
data Tree a
Constructors
Node (Map String (Tree a))
Leaf a
empty :: Tree a
An empty tree.
fromList :: [(Path, a)] -> Tree a
Construct a path tree from a list of (path, value) pairs. Uses the last value if there a duplicate paths. Note that if a leaf L2 with a path p comes after a leaf L1 with a path which has p as a prefix, L1 disappears.
insert :: Path -> a -> Tree a -> Tree a
lookup :: Monad m => Path -> Tree a -> m a
toList :: Tree a -> [(Path, a)]
addPrefix
:: PathPrefix to add to the paths.
-> Tree a
-> Tree a
Add a prefix to all path in a tree.
Produced by Haddock version 0.7