Summary: Functions for transforming a rule specification to a rule.
- data RuleSpec a = a :~> a
- lhsR :: RuleSpec a -> a
- rhsR :: RuleSpec a -> a
- type Rule a = RuleSpec (SchemeOf a)
- type SchemeOf a = Scheme (PF a)
- type Metavar = Int
- metavar :: Metavar -> Scheme f
- pf :: f (Scheme f) -> Scheme f
- toScheme :: (Regular a, Functor (PF a)) => a -> SchemeOf a
- data SchemeView f
- schemeView :: Scheme f -> SchemeView f
- foldScheme :: Functor f => (Metavar -> a) -> (f a -> a) -> Scheme f -> a
- class Regular (Target a) => Builder a where
- ruleM :: (Builder r, Crush (PF (Target r)), Zip (PF (Target r)), Functor (PF (Target r))) => r -> Maybe (Rule (Target r))
- rule :: (Builder r, Crush (PF (Target r)), Functor (PF (Target r)), Zip (PF (Target r))) => r -> Rule (Target r)
Specifies a rule as a value of a datatype.
|a :~> a|
Representation of a rule.
Recursively converts a value to a
A view on schemes to easily distinguish metavariables from pattern functor values.
Scheme value given a function to apply to metavariables and a
function to apply to a pattern functor value.
Builder for transforming a rule specification to a rule.
The type class
Builder captures the functions, that are defined by
induction on the type argument, that construct appropriate
right values. These values are used to transform a rule specification
to a rule.
Transforms a rule specification to a rule and returns
an unbound metavariable occurs in the right-hand side of the rule.