From 7c09fd1503a5ba81d4e490bdbfe90d9ccb5c2174 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 17 Nov 2015 17:05:16 -0800 Subject: [PATCH] Stub in interpretation. --- src/Interpreter.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Interpreter.hs b/src/Interpreter.hs index 89630a602..c83afb571 100644 --- a/src/Interpreter.hs +++ b/src/Interpreter.hs @@ -1 +1,16 @@ module Interpreter where + +import Algorithm +import Control.Monad.Free +import Control.Comonad.Cofree +import Operation +import Diff + +recur :: Term a Info -> Term a Info -> Maybe (Diff a) +recur a b = + run algorithm where + algorithm = Free $ Recursive a b Pure + + +run :: Algorithm a (Diff a) -> Maybe (Diff a) +run (Pure diff) = Just diff