ddc-core-simpl-0.4.1.3: Disciplined Disciple Compiler code transformations.
DDC.Core.Transform.Rewrite.Match
Contents
Description
Create substitution to make (subst template) == target
Synopsis
type SubstInfo a n = (Map n (Exp a n), Map n (Type n))Source
Value and type substition.
emptySubstInfo :: SubstInfo a nSource
An empty substition info.
matchSource
Arguments
Current substitution
Variables we're interested in
Template expression.
Target expression.
Create substitution to make (subst template) == target Does not handle higher-order templates (ie ones with binders)
match emptySubstInfo (Set.fromList [r1, r2, s]) (stream [r1] (unstream [r2] s)) (stream [R0] (someStream 23)) => { r1 |-> R0#, r2 |-> R1, s |-> someStream 23 }