From 7a8466c695e41b03e608c119a690820c22bd63d3 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 27 Feb 2018 16:51:44 -0500 Subject: [PATCH] Use AbstractFunction to evaluate Declaration.Function. --- src/Data/Syntax/Declaration.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Data/Syntax/Declaration.hs b/src/Data/Syntax/Declaration.hs index 58ee40c09..df1e90be5 100644 --- a/src/Data/Syntax/Declaration.hs +++ b/src/Data/Syntax/Declaration.hs @@ -48,9 +48,7 @@ instance ( Semigroup (Cell l (Value l t)) eval Function{..} = do env <- ask let params = toList (liftFreeVariables (freeVariables . subterm) functionParameters) - -- FIXME: Can we store the action evaluating the body in the Value instead of the body term itself? - let v = inj (Closure params (subterm functionBody) env) :: Value l t - + v <- abstract params functionBody (name, addr) <- lookupOrAlloc (subterm functionName) v env modify (envInsert name addr) pure v