From 5ac5d80875d3c5646f2861bb8e12bfb0362741b6 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 10 Sep 2017 20:03:32 +0100 Subject: [PATCH] Define a smart constructor for metavariable diffs. --- src/Diff.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Diff.hs b/src/Diff.hs index 3e3132ca7..c90270211 100644 --- a/src/Diff.hs +++ b/src/Diff.hs @@ -149,6 +149,9 @@ deleting = cata (Diff . Patch . Delete) copy :: Both ann -> syntax (Diff syntax ann) -> Diff syntax ann copy = (Diff .) . (Copy [] .) . (:<) +var :: Metavar -> Diff syntax ann +var = Diff . Var + instance Pretty Metavar where pretty (Metavar v) = pretty v