add + operator on lists
This commit is contained in:
parent
0800608479
commit
ce5083fad9
|
@ -59,6 +59,7 @@ instance Show Value where
|
||||||
-- value operators
|
-- value operators
|
||||||
(IntV l) +$ (IntV r) = IntV (l + r)
|
(IntV l) +$ (IntV r) = IntV (l + r)
|
||||||
(StrV l) +$ (StrV r) = StrV (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
|
l +$ r = error $ "cannot + " ++ show l ++ " and " ++ show r
|
||||||
|
|
||||||
(IntV l) -$ (IntV r) = IntV (l - r)
|
(IntV l) -$ (IntV r) = IntV (l - r)
|
||||||
|
|
Loading…
Reference in New Issue