aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Verilog/CodeGen.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@ymhg.org>2019-05-13 14:58:34 +0100
committerYann Herklotz <git@ymhg.org>2019-05-13 14:58:34 +0100
commit4ecf423075f146ee0a1a452a5658e7a13f99aa9b (patch)
tree36ba41829cee08d217e419eeff4ce65583d89854 /src/VeriFuzz/Verilog/CodeGen.hs
parent426f0d71eca2dc578e4258df05be296003c3e4cb (diff)
downloadverismith-4ecf423075f146ee0a1a452a5658e7a13f99aa9b.tar.gz
verismith-4ecf423075f146ee0a1a452a5658e7a13f99aa9b.zip
Use NonEmpty to represent concatenation
Diffstat (limited to 'src/VeriFuzz/Verilog/CodeGen.hs')
-rw-r--r--src/VeriFuzz/Verilog/CodeGen.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/VeriFuzz/Verilog/CodeGen.hs b/src/VeriFuzz/Verilog/CodeGen.hs
index 71ba162..3ff39d9 100644
--- a/src/VeriFuzz/Verilog/CodeGen.hs
+++ b/src/VeriFuzz/Verilog/CodeGen.hs
@@ -139,7 +139,7 @@ expr (Number b ) = showNum b
expr (Id i ) = identifier i
expr (VecSelect i e ) = hcat [identifier i, brackets $ expr e]
expr (RangeSelect i r ) = hcat [identifier i, range r]
-expr (Concat c ) = braces . nest 4 . sep $ punctuate comma (expr <$> c)
+expr (Concat c ) = braces . nest 4 . sep . punctuate comma $ toList (expr <$> c)
expr (UnOp u e ) = parens $ hcat [unaryOp u, expr e]
expr (Cond l t f) = parens . nest 4 $ sep [expr l <+> "?", hsep [expr t, colon, expr f]]
expr (Appl f e) = hcat [identifier f, parens $ expr e]
@@ -155,7 +155,7 @@ showNum (BitVec s n) =
constExpr :: ConstExpr -> Doc a
constExpr (ConstNum b) = showNum b
constExpr (ParamId i) = identifier i
-constExpr (ConstConcat c) = braces . hsep $ punctuate comma (constExpr <$> c)
+constExpr (ConstConcat c) = braces . hsep . punctuate comma $ toList (constExpr <$> c)
constExpr (ConstUnOp u e) = parens $ hcat [unaryOp u, constExpr e]
constExpr (ConstBinOp eRhs bin eLhs) =
parens $ hsep [constExpr eRhs, binaryOp bin, constExpr eLhs]