Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Trees with data on vertices and edges.
- data EdgeTree e v = EdgeTree {}
- data TreeEdge e v = TreeEdge {}
- createEdgeTree :: (a -> v) -> (a -> e) -> (a -> [a]) -> a -> EdgeTree e v
- filterEdgeTree :: ((v, e, v) -> Bool) -> EdgeTree e v -> EdgeTree e v
- filterEdgeTree' :: (v -> e -> Bool) -> EdgeTree e v -> EdgeTree e v
- mapEdgeTree :: ((v, e, v) -> w) -> w -> EdgeTree e v -> EdgeTree e w
- mapEdgeTree' :: (v -> e -> w) -> w -> EdgeTree e v -> EdgeTree e w
- mapTop :: (EdgeTree e v -> a) -> EdgeTree e v -> [(e, a)]
- truncateEdgeTree :: Int -> EdgeTree e v -> EdgeTree e v
- putEdgeForest :: Int -> (a -> String) -> (v -> String) -> (e -> String) -> [(a, EdgeTree e v)] -> IO ()
- hPutEdgeForest :: Handle -> Int -> (a -> String) -> (v -> String) -> (e -> String) -> [(a, EdgeTree e v)] -> IO ()
- putEdgeTree :: Int -> (v -> String) -> (e -> String) -> EdgeTree e v -> IO ()
- putEdgeTree' :: Int -> String -> (v -> String) -> (e -> String) -> EdgeTree e v -> IO ()
- hPutEdgeTree :: Handle -> Int -> (v -> String) -> (e -> String) -> EdgeTree e v -> IO ()
- hPutEdgeTree' :: Handle -> Int -> String -> (v -> String) -> (e -> String) -> EdgeTree e v -> IO ()
- putTreeEdge' :: Int -> String -> (v -> String) -> (e -> String) -> TreeEdge e v -> IO ()
- hPutTreeEdge' :: Handle -> Int -> String -> (v -> String) -> (e -> String) -> TreeEdge e v -> IO ()
Types
A tree with data at the vertex and edges radiating from it.
An edge with data and connecting to a tree.
Functions
:: (a -> v) | Function for labelling vertices. |
-> (a -> e) | Function for labelling edges. |
-> (a -> [a]) | Function for generating objects radiating from the starting object. |
-> a | The starting objects. |
-> EdgeTree e v | The tree. |
Create a tree.
:: ((v, e, v) -> Bool) | Function for filtering based on vertex-edge-vertex labelling. |
-> EdgeTree e v | The tree. |
-> EdgeTree e v | The filtered tree. |
Filter a tree.
:: (v -> e -> Bool) | Function for filtering based on vextex-edge labelling. |
-> EdgeTree e v | The tree. |
-> EdgeTree e v | The filtered tree. |
Filter a tree.
:: ((v, e, v) -> w) | Function for evaluating vertex-edge-vertex triplets. |
-> w | The new value for the root of the tree. |
-> EdgeTree e v | The tree. |
-> EdgeTree e w | The transformed tree. |
Evaluate a function on vertices of a tree.
:: (v -> e -> w) | Function for evaluating vertex-edge-vertex triplets. |
-> w | The new value for the root of the tree. |
-> EdgeTree e v | The tree. |
-> EdgeTree e w | The transformed tree. |
Evaluate a function on vertices of a tree.
mapTop :: (EdgeTree e v -> a) -> EdgeTree e v -> [(e, a)] Source #
Apply a function to the first subtrees.
truncateEdgeTree :: Int -> EdgeTree e v -> EdgeTree e v Source #
Truncate a tree at a particular depth.
Input/output
:: Int | How many levels to print. |
-> (a -> String) | Function for rendering the label for a tree. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> [(a, EdgeTree e v)] | The forest. |
-> IO () | The action for printing the forest. |
Print a forest.
:: Handle | Where to print the forest. |
-> Int | How many levels to print. |
-> (a -> String) | Function for rendering the label for a tree. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> [(a, EdgeTree e v)] | The forest. |
-> IO () | The action for printing the forest. |
Print a forest.
:: Int | How many levels to print. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> EdgeTree e v | The tree. |
-> IO () | The action for printing the tree. |
Print a tree.
:: Int | How many levels to print. |
-> String | The string for indentation, which will be prefixed to each line output. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> EdgeTree e v | The tree. |
-> IO () | The action for printing the tree. |
Print a tree.
:: Handle | Where to print the tree. |
-> Int | How many levels to print. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> EdgeTree e v | The tree. |
-> IO () | The action for printing the tree. |
Print a tree.
:: Handle | Where to print the tree. |
-> Int | How many levels to print. |
-> String | The string for indentation, which will be prefixed to each line output. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> EdgeTree e v | The tree. |
-> IO () | The action for printing the tree. |
Print a tree.
:: Int | How many levels to print. |
-> String | The string for indentation, which will be prefixed to each line output. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> TreeEdge e v | The edge. |
-> IO () | THe action for printing the edge. |
Print an edge.
:: Handle | Where to print the tree. |
-> Int | How many levels to print. |
-> String | The string for indentation, which will be prefixed to each line output. |
-> (v -> String) | Function for rendering vertex labels. |
-> (e -> String) | Function for rendering edge labels. |
-> TreeEdge e v | The edge. |
-> IO () | THe action for printing the edge. |
Print an edge.