From 4b29933ce947acb9da6fb1d3a61aae186e235843 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Mon, 31 Dec 2018 19:17:04 +0100 Subject: Remove sep and fromList in favour of fold --- src/Test/VeriFuzz/Graph/CodeGen.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Test/VeriFuzz/Graph/CodeGen.hs') diff --git a/src/Test/VeriFuzz/Graph/CodeGen.hs b/src/Test/VeriFuzz/Graph/CodeGen.hs index eaa109e..5d3232c 100644 --- a/src/Test/VeriFuzz/Graph/CodeGen.hs +++ b/src/Test/VeriFuzz/Graph/CodeGen.hs @@ -30,7 +30,7 @@ toOperator Xor = " ^ " statList :: Gate -> [Node] -> Maybe Text statList g n = toStr <$> safe tail n where - toStr = fromList . fmap ((<> toOperator g) . fromNode) + toStr = fold . fmap ((<> toOperator g) . fromNode) lastEl :: [Node] -> Maybe Text lastEl n = fromNode <$> safe head n @@ -45,10 +45,10 @@ toStmnt graph (n, g) = generate :: (Graph gr) => gr Gate e -> Text generate graph = "module generated_module(\n" - <> fromList (imap " input wire " ",\n" inp) - <> sep ",\n" (imap " output wire " "" out) + <> fold (imap " input wire " ",\n" inp) + <> T.intercalate ",\n" (imap " output wire " "" out) <> ");\n" - <> fromList (toStmnt graph <$> labNodes graph) + <> fold (toStmnt graph <$> labNodes graph) <> "endmodule\n\nmodule main;\n initial\n begin\n " <> "$display(\"Hello, world\");\n $finish;\n " <> "end\nendmodule" -- cgit