module Language.Drasil.Code.FileData (FileAndContents(filePath,
fileDoc), fileAndContents, PackageData(packageProg, packageAux), packageData
) where
import Text.PrettyPrint.HughesPJ (Doc, isEmpty)
data FileAndContents = FileAndContents {FileAndContents -> FilePath
filePath :: FilePath, FileAndContents -> Doc
fileDoc :: Doc}
fileAndContents :: FilePath -> Doc -> FileAndContents
fileAndContents :: FilePath -> Doc -> FileAndContents
fileAndContents = FilePath -> Doc -> FileAndContents
FileAndContents
data PackageData a = PackD {forall a. PackageData a -> a
packageProg :: a, forall a. PackageData a -> [FileAndContents]
packageAux :: [FileAndContents]}
packageData :: a -> [FileAndContents] -> PackageData a
packageData :: forall a. a -> [FileAndContents] -> PackageData a
packageData a
p [FileAndContents]
as = a -> [FileAndContents] -> PackageData a
forall a. a -> [FileAndContents] -> PackageData a
PackD a
p ((FileAndContents -> Bool) -> [FileAndContents] -> [FileAndContents]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool
not (Bool -> Bool)
-> (FileAndContents -> Bool) -> FileAndContents -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Doc -> Bool
isEmpty (Doc -> Bool)
-> (FileAndContents -> Doc) -> FileAndContents -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FileAndContents -> Doc
fileDoc) [FileAndContents]
as)