Library to support lightweight generic traversals
through tree-structured data.
See here
for a description of the library.
Author: Sebastian Fischer
Version: February 2008
| Exported names: |
Datatypes:
Traversable
Functions:
childFamilies
| children
| evalChildFamilies
| evalChildFamiliesIO
| evalFamily
| evalFamilyIO
| family
| fold
| foldChildren
| mapChildFamilies
| mapChildFamiliesIO
| mapChildren
| mapChildrenIO
| mapFamily
| mapFamilyIO
| noChildren
| replaceChildren
| replaceChildrenIO
| Summary of exported functions: |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
| Imported modules: |
| Exported datatypes: |
A datatype is Traversable if it defines a function
that can decompose a value into a list of children of the same type
and recombine new children to a new value of the original type.
Type synonym: Traversable a b = a -> ([b],[b] -> a)
| Exported functions: |
:: a -> ([b],[b] -> a)
Traversal function for constructors without children.
:: (a -> ([b],[b] -> a)) -> a -> [b]
Yields the children of a value.
:: (a -> ([b],[b] -> a)) -> a -> [b] -> a
Replaces the children of a value.
:: (a -> ([b],[b] -> a)) -> (b -> b) -> a -> a
Applies the given function to each child of a value.
:: (a -> ([a],[a] -> a)) -> a -> [a]
Computes a list of the given value, its children, those children, etc.
:: (a -> ([b],[b] -> a)) -> (b -> ([b],[b] -> b)) -> a -> [b]
Computes a list of family members of the children of a value.
The value and its children can have different types.
:: (a -> ([a],[a] -> a)) -> (a -> a) -> a -> a
Applies the given function to each member of the family of a value.
Proceeds bottom-up.
:: (a -> ([b],[b] -> a)) -> (b -> ([b],[b] -> b)) -> (b -> b) -> a -> a
Applies the given function to each member of the families of the children
of a value. The value and its children can have different types.
Proceeds bottom-up.
:: (a -> ([a],[a] -> a)) -> (a -> Maybe a) -> a -> a
Applies the given function to each member of the family of a value
as long as possible. On each member of the family of the result the given
function will yield Nothing.
Proceeds bottom-up.
:: (a -> ([b],[b] -> a)) -> (b -> ([b],[b] -> b)) -> (b -> Maybe b) -> a -> a
Applies the given function to each member of the families of the children
of a value as long as possible.
Similar to 'evalFamily'.
:: (a -> ([a],[a] -> a)) -> (a -> [b] -> b) -> a -> b
Implements a traversal similar to a fold with possible default cases.
:: (a -> ([b],[b] -> a)) -> (b -> ([b],[b] -> b)) -> (a -> [c] -> d) -> (b -> [c] -> c) -> a -> d
Fold the children and combine the results.
:: (a -> ([b],[b] -> a)) -> a -> IO [b] -> IO a
IO version of replaceChildren
:: (a -> ([b],[b] -> a)) -> (b -> IO b) -> a -> IO a
IO version of mapChildren
:: (a -> ([a],[a] -> a)) -> (a -> IO a) -> a -> IO a
IO version of mapFamily
:: (a -> ([b],[b] -> a)) -> (b -> ([b],[b] -> b)) -> (b -> IO b) -> a -> IO a
IO version of mapChildFamilies
:: (a -> ([a],[a] -> a)) -> (a -> IO (Maybe a)) -> a -> IO a
IO version of evalFamily
:: (a -> ([b],[b] -> a)) -> (b -> ([b],[b] -> b)) -> (b -> IO (Maybe b)) -> a -> IO a
IO version of evalChildFamilies