diff --git a/src/Data/Syntax/Statement.hs b/src/Data/Syntax/Statement.hs index d55eb2f9e..9b09810c1 100644 --- a/src/Data/Syntax/Statement.hs +++ b/src/Data/Syntax/Statement.hs @@ -77,8 +77,11 @@ instance Eq1 Let where liftEq = genericLiftEq instance Ord1 Let where liftCompare = genericLiftCompare instance Show1 Let where liftShowsPrec = genericLiftShowsPrec --- TODO: Implement Eval instance for Let -instance Evaluatable Let +instance Evaluatable Let where + eval Let{..} = do + addr <- snd <$> letrec name (subtermValue letValue) + localEnv (Env.insert name addr) (subtermValue letBody) + where name = freeVariable (subterm letVariable) -- Assignment