Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
Rewrite t u s
defines a rewrite rule \( t \rightarrow u \), with
an optional name s
.
Instances
Generic Rewrite Source # | |
Show Rewrite Source # | |
Eq Rewrite Source # | |
Ord Rewrite Source # | |
Defined in Language.REST.Internal.Rewrite | |
Hashable Rewrite Source # | |
Defined in Language.REST.Internal.Rewrite | |
Monad m => RewriteRule m Rewrite RuntimeTerm Source # | |
Defined in Language.REST.Internal.Rewrite apply :: RuntimeTerm -> Rewrite -> m (HashSet RuntimeTerm) Source # | |
type Rep Rewrite Source # | |
Defined in Language.REST.Internal.Rewrite type Rep Rewrite = D1 ('MetaData "Rewrite" "Language.REST.Internal.Rewrite" "rest-rewrite-0.4.3-L4CHsmDzf4PMYNf7CqgfF" 'False) (C1 ('MetaCons "Rewrite" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MetaTerm) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MetaTerm) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String))))) |
type Subst = HashMap String RuntimeTerm Source #
Subst
is a mapping from variable names to RuntimeTerm
s.
Normally this would be generated by unifying the left-hand-side of
a Rewrite
with a term.
named :: Rewrite -> String -> Rewrite Source #
named r n
assigns the name n
to rule r
, replacing any
existing name
subst :: Subst -> MetaTerm -> RuntimeTerm Source #
subst s m
replaces the variables in the MetaTerm
m
with RuntimeTerm
s
in the substitution s
. This function returns an error if any variables in m
do not have a substituion