rewriting-0.2: Generic rewriting library for regular datatypes.Source codeContentsIndex
Generics.Regular.Rewriting.Machinery
Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Contents
Type class synonym summarizing generic functions.
Applying a rule specification to a term.
Rewriting a term.
Description
Summary: Core machinery for rewriting terms.
Synopsis
class (Regular a, CrushR (PF a), GMap (PF a), GShow (PF a), Zip (PF a), LR (PF a), Functor (PF a)) => Rewrite a
applyRuleM :: (Builder r, Rewrite (Target r), Monad m) => r -> Target r -> m (Target r)
applyRule :: (Builder r, Rewrite (Target r)) => r -> Target r -> Target r
rewriteM :: (Rewrite a, Monad m) => Rule a -> a -> m a
rewrite :: Rewrite a => Rule a -> a -> a
Type class synonym summarizing generic functions.
class (Regular a, CrushR (PF a), GMap (PF a), GShow (PF a), Zip (PF a), LR (PF a), Functor (PF a)) => Rewrite a Source

The Rewrite is a type class synonym, hiding some of the implementation details.

To be able to use the rewriting functions, the user is required to provide an instance of this type class.

Applying a rule specification to a term.
applyRuleM :: (Builder r, Rewrite (Target r), Monad m) => r -> Target r -> m (Target r)Source
Applies a rule specification to a term, obtaining a monadic value.
applyRule :: (Builder r, Rewrite (Target r)) => r -> Target r -> Target rSource
Applies a rule specification to a term, obtaining the original term when rewriting fails.
Rewriting a term.
rewriteM :: (Rewrite a, Monad m) => Rule a -> a -> m aSource
Rewrites a term, obtaining a monadic value.
rewrite :: Rewrite a => Rule a -> a -> aSource
Rewrites a term, obtaining the original term when rewriting fails.
Produced by Haddock version 2.4.2