From 04fdced12be9722608dbff8b46fd2c6663599dc0 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Tue, 12 May 2015 19:32:11 +0200 Subject: [PATCH] small update fix --- fp2/week45/mart/RefactorX.dcl | 2 +- fp2/week45/mart/RefactorX.icl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fp2/week45/mart/RefactorX.dcl b/fp2/week45/mart/RefactorX.dcl index e71f36b..e7fef07 100644 --- a/fp2/week45/mart/RefactorX.dcl +++ b/fp2/week45/mart/RefactorX.dcl @@ -1,5 +1,6 @@ definition module RefactorX +from StdClass import class toString import StdEnv :: Expr = NR Int | VAR Name | OP Expr Operator Expr | LET Name Expr Expr @@ -7,7 +8,6 @@ import StdEnv :: Operator = PLUS | MIN | MUL | DIV :: Val = Result Int | Undef -from StdClass import class toString instance toString Expr free :: Expr -> [Name] diff --git a/fp2/week45/mart/RefactorX.icl b/fp2/week45/mart/RefactorX.icl index 3898c14..1334aac 100644 --- a/fp2/week45/mart/RefactorX.icl +++ b/fp2/week45/mart/RefactorX.icl @@ -57,9 +57,8 @@ apply o (Result e1) (Result e2) = Result (apply` o e1 e2) apply` MUL = * apply` DIV = / - eval:: Expr -> Val -eval e = eval` (remove_unused_lets e) [] +eval e = eval` e [] where eval`:: Expr [(Name, Val)] -> Val eval` (NR n) _ = Result n -- 2.20.1