Maintainer | bastiaan.heeren@ou.nl |
---|---|

Stability | provisional |

Portability | portable (depends on ghc) |

Safe Haskell | None |

Language | Haskell98 |

Representation of a strategy as a cyclic tree with explicit fixed-points. The nodes in the tree are named strategy combinators. The leafs are rules.

- type StrategyTree a = CyclicTree (Decl Nary) (Leaf a)
- data Leaf a
- treeToProcess :: StrategyTree a -> Process (Leaf a)
- mapRulesInTree :: (Rule a -> Rule a) -> StrategyTree a -> StrategyTree a
- data Decl f
- type Combinator f = forall a. f (Process (Leaf a))
- associative :: Decl f -> Decl f
- isAssociative :: Decl f -> Bool
- combinator :: Decl f -> Combinator f
- (.=.) :: IsId n => n -> Combinator f -> Decl f
- applyDecl :: Arity f => Decl f -> f (StrategyTree a)
- data Dynamic a
- makeDynamic :: (IsId n, IsTerm a) => n -> (a -> StrategyTree a) -> Dynamic a
- dynamicToTerm :: Dynamic a -> a -> Maybe Term
- dynamicTree :: Dynamic a -> a -> Maybe (StrategyTree a)
- dynamicFromTerm :: Dynamic a -> Term -> Maybe (StrategyTree a)
- class Arity f where
- newtype Nullary a = Nullary {
- fromNullary :: a

- newtype Unary a = Unary {
- fromUnary :: a -> a

- newtype Binary a = Binary {
- fromBinary :: a -> a -> a

- newtype Nary a = Nary {
- fromNary :: [a] -> a

# StrategyTree type synonym

type StrategyTree a = CyclicTree (Decl Nary) (Leaf a) Source #

treeToProcess :: StrategyTree a -> Process (Leaf a) Source #

mapRulesInTree :: (Rule a -> Rule a) -> StrategyTree a -> StrategyTree a Source #

# Declarations (named combinators)

type Combinator f = forall a. f (Process (Leaf a)) Source #

associative :: Decl f -> Decl f Source #

isAssociative :: Decl f -> Bool Source #

combinator :: Decl f -> Combinator f Source #

# Dynamic strategies

makeDynamic :: (IsId n, IsTerm a) => n -> (a -> StrategyTree a) -> Dynamic a Source #

dynamicTree :: Dynamic a -> a -> Maybe (StrategyTree a) Source #

dynamicFromTerm :: Dynamic a -> Term -> Maybe (StrategyTree a) Source #