- -- Create signal declarations for all signals that are not in args and
- -- res
- sig_decs = [mkSigDec info | (id, info) <- sigs, (all (id `Foldable.notElem`) (res:args)) ]
- -- Create component instantiations for all function applications
- insts = map (AST.CSISm . mkCompInsSm) apps
- arch = AST.ArchBody (mkVHDLId "structural") (AST.NSimple entity_id) (map AST.BDISD sig_decs) insts
- in
- setArchitecture hsfunc arch
+ -- Create signal declarations for all signals that are not in args and
+ -- res
+ let sig_decs = [mkSigDec info | (id, info) <- sigs, (all (id `Foldable.notElem`) (res:args)) ]
+ -- Create component instantiations for all function applications
+ insts <- mapM mkCompInsSm apps
+ let insts' = map AST.CSISm insts
+ let arch = AST.ArchBody (mkVHDLId "structural") (AST.NSimple entity_id) (map AST.BDISD sig_decs) insts'
+ setArchitecture hsfunc arch