m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Abs.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Abs.hs b/Abs.hs
index cfdd854..2380fa1 100644
--- a/Abs.hs
+++ b/Abs.hs
@@ -21,7 +21,11 @@ instance Show Val where
show (VAbs x t _ _) = "#(lambda " ++ (show x) ++ " : " ++ (show t) ++ ")"
show (VTr) = "true"
show (VFl) = "false"
- show (VVrnt l v _) = "<" ++ (show l) ++ " " ++ (show v) ++ ">"
- show (VTpl vs) = "{" ++ (show vs) ++ "}"
+ show (VVrnt (Ident l) v _) = "<" ++ l ++ " " ++ (show v) ++ ">"
+ show (VTpl vs) = "{" ++ (show' vs) ++ "}"
show (VNil t) = "nil"
show (VCons v1 v2) = "(cons " ++ (show v1) ++ " " ++ (show v2) ++ ")"
+
+show' = cleanup . Prelude.foldl (\s v -> s ++ (show v) ++ ", ") ""
+ where cleanup [] = ""
+ cleanup l = init $ init l