+ ports = concatMap (mapToPorts AST.In) args
+ ++ mapToPorts AST.Out res
+ mapToPorts :: AST.Mode -> VHDLSignalMap -> [AST.IfaceSigDec]
+ mapToPorts mode m =
+ map (mkIfaceSigDec mode) (Foldable.toList m)
+
+-- | Create a port declaration
+mkIfaceSigDec ::
+ AST.Mode -- | The mode for the port (In / Out)
+ -> (AST.VHDLId, AST.TypeMark) -- | The id and type for the port
+ -> AST.IfaceSigDec -- | The resulting port declaration
+
+mkIfaceSigDec mode (id, ty) = AST.IfaceSigDec id mode ty