diff --git a/interp.hs b/interp.hs index 562f5a1..1a14602 100644 --- a/interp.hs +++ b/interp.hs @@ -59,6 +59,7 @@ instance Show Value where -- value operators (IntV l) +$ (IntV r) = IntV (l + r) (StrV l) +$ (StrV r) = StrV (l ++ r) +(ListV l) +$ (ListV r) = ListV (l ++ r) l +$ r = error $ "cannot + " ++ show l ++ " and " ++ show r (IntV l) -$ (IntV r) = IntV (l - r)