add + operator on lists

This commit is contained in:
darkf 2013-10-23 15:06:57 -07:00
parent 0800608479
commit ce5083fad9
1 changed files with 1 additions and 0 deletions

View File

@ -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)