From ce5083fad9da85fd9ab96a1ac430cf6c04173129 Mon Sep 17 00:00:00 2001 From: darkf Date: Wed, 23 Oct 2013 15:06:57 -0700 Subject: [PATCH] add + operator on lists --- interp.hs | 1 + 1 file changed, 1 insertion(+) 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)