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

Stability | provisional |

Portability | portable (depends on ghc) |

Safe Haskell | None |

Language | Haskell98 |

- class Different a where
- data RewriteRule a
- ruleSpecTerm :: RewriteRule a -> RuleSpec Term
- data RuleSpec a = a :~> a
- makeRewriteRule :: (IsId n, RuleBuilder f a) => n -> f -> RewriteRule a
- termRewriteRule :: (IsId n, IsTerm a, Show a) => n -> RuleSpec Term -> RewriteRule a
- class (IsTerm a, Show a) => RuleBuilder t a | t -> a where
- showRewriteRule :: Bool -> RewriteRule a -> Maybe String
- metaInRewriteRule :: RewriteRule a -> [Int]
- renumberRewriteRule :: Int -> RewriteRule a -> RewriteRule a
- symbolMatcher :: Symbol -> SymbolMatch -> RewriteRule a -> RewriteRule a
- symbolBuilder :: Symbol -> ([Term] -> Term) -> RewriteRule a -> RewriteRule a

# Supporting type class

class Different a where Source #

Different Bool Source # | |

Different Char Source # | |

Different Double Source # | |

Different Float Source # | |

Different Int Source # | |

Different Integer Source # | |

Different Rational Source # | |

Different Term Source # | |

Different a => Different [a] Source # | |

(Different a, Different b) => Different (a, b) Source # | |

(Different a, Different b, Different c) => Different (a, b, c) Source # | |

# Rewrite rules and specs

data RewriteRule a Source #

ruleSpecTerm :: RewriteRule a -> RuleSpec Term Source #

a :~> a infixl 1 |

# Compiling rewrite rules

makeRewriteRule :: (IsId n, RuleBuilder f a) => n -> f -> RewriteRule a Source #

termRewriteRule :: (IsId n, IsTerm a, Show a) => n -> RuleSpec Term -> RewriteRule a Source #

class (IsTerm a, Show a) => RuleBuilder t a | t -> a where Source #

(IsTerm a, Show a) => RuleBuilder (RuleSpec a) a Source # | |

(Different a, RuleBuilder t b) => RuleBuilder (a -> t) b Source # | |

# Using rewrite rules

showRewriteRule :: Bool -> RewriteRule a -> Maybe String Source #

metaInRewriteRule :: RewriteRule a -> [Int] Source #

renumberRewriteRule :: Int -> RewriteRule a -> RewriteRule a Source #

symbolMatcher :: Symbol -> SymbolMatch -> RewriteRule a -> RewriteRule a Source #

symbolBuilder :: Symbol -> ([Term] -> Term) -> RewriteRule a -> RewriteRule a Source #