From f6c8cd81da3f0dd346535b3db420bf90f5d72a34 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 3 Aug 2016 18:15:18 -0400 Subject: [PATCH] Add a smart constructor for Recursive operations. --- src/Algorithm.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Algorithm.hs b/src/Algorithm.hs index 970b9c7d6..4a6f7dc7c 100644 --- a/src/Algorithm.hs +++ b/src/Algorithm.hs @@ -19,3 +19,6 @@ data AlgorithmF -- | A lazily-produced AST for diffing. type Algorithm a annotation = Free (AlgorithmF a annotation) + +recursively :: Term leaf annotation -> Term leaf annotation -> Algorithm leaf annotation (Diff leaf annotation) +recursively a b = wrap (Recursive a b pure)