diff options
-rw-r--r-- | Abs.hs | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |