module Language.Drasil.Code.Imperative.GOOL.Data (AuxData(auxFilePath, auxDoc),
ad, PackData(packProg, packAux), packD
) where
import Drasil.GOOL (ProgData)
import Text.PrettyPrint.HughesPJ (Doc, isEmpty)
data AuxData = AD {AuxData -> FilePath
auxFilePath :: FilePath, AuxData -> Doc
auxDoc :: Doc}
ad :: FilePath -> Doc -> AuxData
ad :: FilePath -> Doc -> AuxData
ad = FilePath -> Doc -> AuxData
AD
data PackData = PackD {PackData -> ProgData
packProg :: ProgData, PackData -> [AuxData]
packAux :: [AuxData]}
packD :: ProgData -> [AuxData] -> PackData
packD :: ProgData -> [AuxData] -> PackData
packD ProgData
p [AuxData]
as = ProgData -> [AuxData] -> PackData
PackD ProgData
p ((AuxData -> Bool) -> [AuxData] -> [AuxData]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool) -> (AuxData -> Bool) -> AuxData -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Doc -> Bool
isEmpty (Doc -> Bool) -> (AuxData -> Doc) -> AuxData -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AuxData -> Doc
auxDoc) [AuxData]
as)