Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- newtype Tree m a = Tree {}
- data Node m a = Node {
- nodeValue :: a
- nodeChildren :: [Tree m a]
- fromNode :: Applicative m => Node m a -> Tree m a
- unfold :: Monad m => (a -> [a]) -> a -> Tree m a
- unfoldForest :: Monad m => (a -> [a]) -> a -> [Tree m a]
- expand :: Monad m => (a -> [a]) -> Tree m a -> Tree m a
- prune :: Monad m => Tree m a -> Tree m a
- render :: Monad m => Tree m String -> m String
Documentation
An effectful tree, each node in the tree can have an effect before it is produced.
Instances
A node in an effectful tree, as well as its unevaluated children.
Node | |
|
unfold :: Monad m => (a -> [a]) -> a -> Tree m a Source #
Create a tree from a value and an unfolding function.
unfoldForest :: Monad m => (a -> [a]) -> a -> [Tree m a] Source #
Create a forest from a value and an unfolding function.