From 2f5fc49117a754dda2132d1a7aa7a91d9f162989 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 5 Feb 2019 23:39:31 -0800 Subject: [PATCH] Add small fix. --- HW3.fedorind.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HW3.fedorind.hs b/HW3.fedorind.hs index d0504ba..690a808 100644 --- a/HW3.fedorind.hs +++ b/HW3.fedorind.hs @@ -70,8 +70,8 @@ prettyPrintCmd (Move l r) = [ "move(" ++ prettyPrintExpr l ++ ", " ++ prettyPrin prettyPrintCmd (Define m vs cmds) = ("define " ++ m ++ "(" ++ intercalate ", " vs ++ ") {") : map (" " ++) (cmds >>= prettyPrintCmd) ++ [ "}" ] prettyPrintCmd (Call n xs) = [ "call " ++ n ++ "(" ++ intercalate ", " (map prettyPrintExpr xs) ++ ");" ] -prettyPrint :: Prog -> String -prettyPrint prog = intercalate "\n" $ (prog >>= prettyPrintCmd) ++ [ "" ] +pretty :: Prog -> String +pretty prog = intercalate "\n" $ (prog >>= prettyPrintCmd) ++ [ "" ] macros :: Prog -> [Macro] macros xs = xs >>= macrosC