Simplify and refactor moduleFiles oracle.
[hadrian.git] / src / Settings.hs
1 module Settings (
2 module Settings.Packages,
3 module Settings.Paths,
4 module Settings.User,
5 module Settings.Ways,
6 getPkgData, getPkgDataList, getTopDirectory, isLibrary,
7 getPackagePath, getContextDirectory, getContextPath
8 ) where
9
10 import Base
11 import Expression
12 import Oracles.PackageData
13 import Oracles.WindowsPath
14 import Settings.Packages
15 import Settings.Paths
16 import Settings.User
17 import Settings.Ways
18
19 getPackagePath :: Expr FilePath
20 getPackagePath = pkgPath <$> getPackage
21
22 getContextDirectory :: Expr FilePath
23 getContextDirectory = contextDirectory <$> getContext
24
25 getContextPath :: Expr FilePath
26 getContextPath = contextPath <$> getContext
27
28 getPkgData :: (FilePath -> PackageData) -> Expr String
29 getPkgData key = lift . pkgData . key =<< getContextPath
30
31 getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
32 getPkgDataList key = lift . pkgDataList . key =<< getContextPath
33
34 getTopDirectory :: Expr FilePath
35 getTopDirectory = lift topDirectory