-getDesignFiles :: VHDLState [AST.DesignFile]
-getDesignFiles = do
- -- Extract the library units generated from all the functions in the
- -- session.
- funcs <- getFuncs
- let units = Maybe.mapMaybe getLibraryUnits funcs
- let context = [
- AST.Library $ mkVHDLId "IEEE",
- AST.Use $ (AST.NSimple $ mkVHDLId "IEEE.std_logic_1164") AST.:.: AST.All]
- return $ map (AST.DesignFile context) units
+getDesignFiles :: [FuncData] -> [AST.DesignFile]
+getDesignFiles funcs =
+ map (AST.DesignFile context) units
+ where
+ units = filter (not.null) $ map getLibraryUnits funcs
+ context = [
+ AST.Library $ mkVHDLId "IEEE",
+ AST.Use $ (AST.NSimple $ mkVHDLId "IEEE.std_logic_1164") AST.:.: AST.All]