diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-12-31 19:17:04 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-12-31 19:17:04 +0100 |
commit | 4b29933ce947acb9da6fb1d3a61aae186e235843 (patch) | |
tree | 6d8e5ec30e3ada7b057bd663340ec9432926a15c /src/Test/VeriFuzz/Graph/CodeGen.hs | |
parent | 8dd9e46314c775b92574b67fc0d7207180fbec78 (diff) | |
download | verismith-4b29933ce947acb9da6fb1d3a61aae186e235843.tar.gz verismith-4b29933ce947acb9da6fb1d3a61aae186e235843.zip |
Remove sep and fromList in favour of fold
Diffstat (limited to 'src/Test/VeriFuzz/Graph/CodeGen.hs')
-rw-r--r-- | src/Test/VeriFuzz/Graph/CodeGen.hs | 8 |
1 files changed, 4 insertions, 4 deletions
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" |