Commit 59802180 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Move isLibrary to src/Package.hs, add isProgram.

parent c98eebc4
......@@ -4,8 +4,8 @@ module Package (
-- * Queries
pkgCabalFile,
matchPackageNames,
-- * Helpers for constructing 'Package's
setPath, topLevel, library, utility, setType
-- * Helpers for constructing and using 'Package's
setPath, topLevel, library, utility, setType, isLibrary, isProgram
) where
import Base
......@@ -48,6 +48,14 @@ setPath pkg path = pkg { pkgPath = path }
setType :: Package -> PackageType -> Package
setType pkg ty = pkg { pkgType = ty }
isLibrary :: Package -> Bool
isLibrary (Package {pkgType=Library}) = True
isLibrary _ = False
isProgram :: Package -> Bool
isProgram (Package {pkgType=Program}) = True
isProgram _ = False
instance Show Package where
show = pkgName
......
......@@ -32,10 +32,6 @@ getPkgDataList key = lift . pkgDataList . key =<< getTargetPath
programPath :: Stage -> Package -> Maybe FilePath
programPath = userProgramPath
isLibrary :: Package -> Bool
isLibrary (Package {pkgType=Library}) = True
isLibrary _ = False
-- Find all Haskell source files for the current target. TODO: simplify.
getPackageSources :: Expr [FilePath]
getPackageSources = do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment